Your management are undoubtedly underperforming in their management of you, but I would give them a tiny benefit of the doubt on one matter. Feel free to ignore this if you don't think it's an accurate reflection of your circumstances, but if it's possibly true, it might explain things.
Were you asked to automate the service? Did you pitch it and get permission to go ahead? Did you see it could be done and went for it?
I ask these questions because if it's the latter, you may have inadvertently caused a planning headache. Yes, automating is better and you improved an area of business efficiency, but as operations director, I have to make long, medium and short term plans for everything that are a carefully balanced ecosystem. I only have so much to give each managee, and their projects knock on to each others, let alone the question of pay grades and authority.
By automating a service and leaving me with a lot of spare capacity, that's a credit in one way, but a task in another - someone who I'd already planned for is now twiddling their thumbs, and they may have altered the timelines of other business functions without my knowledge, causing potentially unknowable knock ons down the line.
Add in a pandemic and a lot of extra responsibility and I'm afraid I might be thinking, "well, it's her own fault she has nothing to do because I don't have the operational time to fit her back into my plans" - especially if there's a lack of trust that you won't go off on one again and exceed your instructions.
There was an absolutely classic example of this by my former manager. I was away on a work trip organised by the CEO, and someone else's line managee came and pitched to him to improve a website function. He did a good spiel, and my line manager ok'd it. Said employee did a good job.
The problem? My work trip was specifically to investigate solutions to the website function. The other employee did a good job on the parameters as he understood them, but a crap job for the parameters he didn't know or understand. The whole work piece had to be redone, and in the meantime, I had to bear the admin headache of reconciling the data (which had actually been easier under the original system!).
All because an 'improvement' was made by an employee who had more time on his hands than instructions to fill them.
(by the way - all three of those managers are history now, and I run a tight ship!)