I have a feeling what's actually happening is the prisoner is given an unloaded gun, puts it in a hole in the wall while a guard on the other side points the barrel of another gun out the second hole at the same time. You don't even need to coordinate trigger pulls, just fire after you tell the prisoner to shoot himself, anyone observing would be too distracted by the literal exploding head to notice if the prisoner moved his finger. Basically it's a magic show murder done for the amusement of the guards, the whole "counts as suicide" thing is just an excuse.
Of course this is all assuming this story is accurate and isn't either total bullshit or the result of the faulty memory of a senile man who was a child at that time (so double the memory fuckery).
So also fun fact, the Nazis did develop a curved barrel for the STG44 for fighting around corners. They even built a special mirror sight system for it so you could still aim. However, the bend was only 45 degrees (not the ludicrous 180 degrees for that story to be true as presented), seriously cut down the effective range, and was only effective for a few dozen shots before it was structurally compromised, making the gun ineffective in any realistic combat situation.https://www.youtube.com/watch?v=HSsFiS2Voxg