I personally know of two people from one company that were fired for contributing a patch to a popular open sourced IDE that the company used for development, of which the bug hampered the development for the company. It was a strongarmed political move for management to retain control over the personal actions of their employees.
This is all anecdotal anyways. I doubt it happens all the time, but these two were forced to sign an NDA on their way out. It makes me wonder how many times it does happen where no one is allowed to talk about it.
But if you are a minion at, say MSFT, imagine how many layers of management a sign-off would go up before somebody said - yes you can assign copyright to that little utility to Gnu.
This is all anecdotal anyways. I doubt it happens all the time, but these two were forced to sign an NDA on their way out. It makes me wonder how many times it does happen where no one is allowed to talk about it.