Not to mention Microsoft’s profits aren’t from the OS but what they get from the user once they have the OS. Once they have the Windows user they then have a market to sell other Microsoft products, not to mention all the stuff on the Windows store. (And of course advertising data)
They don’t need profits from the OS as the OS pays for itself in the long run.
Let’s be honest this is how it actually usually plays out:
Be a huge company
Make your employees sign an NDA
Make your code closed source
Use GPL code and not give a shit because you’re a huge company with a legal team bigger than your Dev team