1. There is no mention of custody
2. I don't think it's fair to infer from that omission.
3. The שות בנימין זאב ס פח that the Rama is predicated upon commands other people not to teach the son of the refuser
4. Not always. The Torah does condone collective punishment in certain cases. See Amalek for example. Modern justice definitely tabooed it further.
I do agree that in this case it does not appear to be merited based on the picture emanting from this thread. I don't have any position on this story other than mercy for all involved, but I care about the general principles.
1. I will need to check the nosei keilim later but I’m fairly certain I’m correct and the Rama is referring to minor children in the father’s household.
2. Explain? The Rama lays out the various remedies available, and says Beis Din can enact whatever they want on the transgressor himself short of nidui. He also lays out criteria of hurting the transgressor (through attacking *his personal obligations* of circumcising his son, burying them, and teaching them Torah) despite the collateral damage to others (what I take to mean minors in the transgressor’s household). That appears to be the upper limit of the allowance- especially with use of the word “afilu”.
3. You are correct, I misquoted what you wrote. However, this refers to the father’s (the transgressor himself) obligation to teach Torah to his son- not as a wanton act against a third party as a form of coercion.
4. Amalek is a poor example, they are all considered to be perpetually guilty. They have the ability to be megayer as well.
I believe you are learning the wrong lesson from the Rama. He is showing how far one can go in attacking the transgressor *himself*, to the point where it can affect others. Of course he would not allow one to attack an innocent third party directly merely because it is “beneficial”. The concept is preposterous.