Companies, specially big consulting companies do something similar to their clients all the time when inflating projects and time, but, somehow, that just sound like business as usual.
I can't think of a state where a program you create to automate your job, that you wrote on company time, wouldn't be the companies property. Of course an employment contract can easily modify the general rule.
For contractors the rule is the opposite. They retain IP by default.
If someone hires you to cut the grass, and you create a machine that does it (the "Yardba"(tm)), there's no reason that machine would belong to the employer - creating it was not a part of your job.
No clause or contract is required for this to be the case. It's the default state. It might be different in other countries but I doubt it.
Employees have a "duty of loyalty". https://www.google.com/search?q=employee+duty+of+loyalty
That would seem to include things like this issue. It also includes not competing with your employer.
The idea of any kind of "duty of loyalty" is absolutely laughable in this day and age. Employers have long since rejected any sense of having loyalty to their employees.
Also, if you're going to link to something, at least link to the Wikipedia article on it. Linking to a Google search is pretty dickish.
here's one for California 2016
http://blogs.orrick.com/trade-secrets-watch/2016/01/19/the-d...