It's more like "the act of confessing is an uncertain gamble, kinda similar to shooting"
English has similar phrases: "having a shot" means having a chance, and "taking the shot" means taking that chance
I believe that's the origin "menembak "(shooting) as confessing
And "ditembak" (getting shot at) becomes being confessed to (TBH I do find it weird as well)
@Velacity