I was only punished like this once as a child. I don't remember what it was for, but I only remember the punishment. So anecdotally, it doesn't seem to work.
Anyone who was often caned/belted/hot-wheel-tracked knows they didn't stop causing trouble, they just weren't afraid of discipline or fighting anymore because it couldn't be much worse than that. Beating children has always been about desensitizing them, not making them behave! Rather than being "raised by women's hands" and becoming soft and submissive, beat them so they can fight and win/live.
Who knows? Maybe it fixed the problem but you don’t remember and now it’s just a part of your ethical framework.
Only time I got corporal punishment was when I stole a small amount of money out of someone’s backpack in school when I was 8. I haven’t stolen a thing in my life since then, like not even candy or a towel from a hotel room.
I was only punished like this once as a child. It was because I beat another kid and took his crayons. It worked like a charm. So YMMV.