In Germany for example you can’t give away the copyright on something you wrote as a person. The only thing you can waive is the distribution part of your copyrighted works.
What you do outside your work hours is only subject to the law, not an employee.