The company paid you to do that work, it's their's.<p>It sucks but that's the cost of a salary. You shouldn't give up though, in your 1x1s, and reviews keep pushing for it and specifically aske what you'd need to do as a next step.
Is the company large enough to have an open source policy? I used to work for a company that had policies for both using open source in products as well as contributing to the community. Open source wasn't fundamental to the culture of the core products however. So actually getting approval was not particularly straightforward e.g. significant interaction with lawyers could be required. In a couple cases, to our detriment, we didn't follow through on contributions. But because there was a policy, it never felt unfair.
There seems to be a lot missing here. What was the "legal flex" that your boss did? And why would you be at risk of some "legal issue" for disclosing this discussion?