E.A.
I doubt that a 21mo child can control that kind of thing, I know mine couldn't, so reprimanding her and expecting results is an exercise in futility. I bet the warm water is "signaling" her muscles to contract, making her unable to control it, as that kind of urge is very strong. If she isn't potty trained to poop in the toilet yet, there's no way to control this, just start giving her showers instead if this is her body's response to a bath. I never ever disciplined for potty accidents, that is only setting them up to fail. Be patient.