I studied law and became a lawyer for a bit and let me tell you. Nothing disillusions you from rules-based morality faster than that lol
I think it helps to realise that all rules are fallible. They were all made up by humans, who are muddling along, who have vested interests, who make mistakes. No human is inherently born above or better than any other human. You have the same status in the universe as the rule-maker.
It can be tiring to always question everything, but after a while it gets easier to spot the patterns. ‘What does this rule actually achieve in material terms, regardless of its stated intentions?’ is a good place to start.
For example I'm seeing rules abusive people in my past have tried to set for me to follow. (Never confront them or theyll victimize you far worse, never resist their orders, always stay quiet about what theyre doing to you, etc...) Instead of getting hung up on those rules and my opinions on them, just see the the purpose of the rules. (The purpose of the rules in this case is for them to tightly control and victimize someone that will never leave or expose them. That is the whole story and you don't need to storytell any further if you catch yourself flashing back.) If the purpose of their rules and your values don't line up, drop them immediately.