If you want to sell it then develop it on your own.
This reads way broader, as you describe it "develop it on your own", but can sell it only once to public sector.
What is my incentive to develop any software at all for public sector, since potential client no. 2 will just take the code that I released?
The ask does not state employed by... it just says:
“Implement legislation requiring that publicly financed software developed for the public sector be made publicly available under a Free and Open Source Software licence.”
I would be fine with
“Implement legislation requiring that publicly financed software developed by employees of public sector, for the public sector be made publicly available under a Free and Open Source Software licence.”
Then, sold to public sector once, then everyone else is free to use it.
Would Microsoft still develops Office? Unlikely.
(Obviously, Microsoft's actual business model is to capture and lock in, that's what makes your example look odd.)
Also, government custom developed software is really wonky and the odds that the IP is sold is very low. The greater odds are that maintenance and follow on contracts will only be possible for the company that first wrote the software.
There’s also licensed deals and subscription services etc. sure, but there’s a ton of custom proprietary software that consultants build (which often contain proprietary business logic).
Custom always costs more of course, but this isn’t a new model by any stretch of the imagination.
As I private person I can offer a programming projects but demand access to the source code , you are free not to bid for my project but I think I am the sane one that wants the code so i am not locked into a corner.
If the government is paying for the development, the government should own the product of that work.
When there is a need for a system, there is a public procurement process wherein contractors submit bids, and the "best" bid wins. ("best" by some criteria, usually price)