Have experienced a ton of this too. One of the biggest internal tool mistakes of my career was to ship a tool like op's: Got yelled at for using company time to work on non-sanctioned work only to have the person yelling at me end up using my tool for 6 years. Colleagues would get pissy with me when drift happened never updating the tool themselves. Was in a weird position where I had no actual "sanctioned time" to work on the tool but was still required to support it.
But... the biggest rub: my manager (yeller from above) took all of the credit when upper execs eventually caught wind as client-facing changes were happening literally days faster. Something about "building a dynamic team where people are allowed to innovate" - my name wasn't even brought up according to the exec that I was close with.
If I could go back and redo everything I'd hide my work as it caused me nothing but pain, suffering, and bitterness. The reward for good work in so many places is a crack of the whip and more work.