It worked long enough for Gates to make enough of a profit.
Well, do you think it would be sufficient now for you to do the same? I think the particular path followed by Microsoft is unrepeatable, and that's not because we like open source OS. If you want to draw a lesson from the success of Microsoft, look at how they leveraged consumer marketing, brand licensing, and partnerships with manufacturers to outcompete everyone else (by all means possible, heheh). The sanctity of Windows source code was always just a unicorn. Plenty of smart folks not employed by Microsoft made a handsome living from understanding precisely how the code worked without having the source code in hand. They just had to waste time reverse engineering it. You must pay for that inefficiency though, and eventually enough folks (Microsoft included!) were willing to embrace the more efficient paradigm which is open source. That's because OPEN SOURCE was out-innovating CLOSED-SOURCE.
Haha, this is really silly for me to argue because Microsoft products are the bread-and-butter foundation of my current income. But ultimately it's unpleasant work when it's incredibly difficult to address deficiencies in dotNet framework whereas a similar problem with an equivalent Python library or LLVM (that is the incredible scope of dotNet) was probably fixed before I could find it, simply because people could fix it.