The time someone takes credit for my work and refuses to fix this, I run. I can, there are so many nice places one can work at, especially with the raise of remote work which I happen to like.
I would not expect my bosses to take my credit. And I do recognize their involvement too. Actually, we edit a public open source project and publish extensions for it, and individual contributors are listed as authors, instead of just the company name.
You have to look at things at the right level of abstraction.
Bosses "program" people, they set them to work on things that need doing. They can be more or less involved in the actual process, but ultimately they're responsible for delivering the thing.
Developers write all the code. Some may feel that they built the whole thing (I have been that person) but that neglects the role others play in figuring out what needs building and actually making it happen.
Edit: I don't believe it's right for others to take credit for someone else's work. I just think that when an executive hears a boss "built" something, they don't think "wow, what an amazing coder". They don't think about code at all. This person delivered a thing that was built. They built it in the organization. That's all it means.