I very much doubt that. Software isn't something that exists in a vacuum and even if you are the sole author of a program, it might contain or be based on trade secrets of the company.
Even if that's not the case, software doesn't generate profit on its own - you still need to sell licences or services based around it. Both of which are equally contributing to any profit a program generates.
Since it's still the employer who bears the entrepreneurial risk, there's a solid argument to be made against winning such a case.
I am curious, what rights have you retained with your work then? What are the corner cases where you might you still want exercise your copyright?
In practical terms this means mostly boopkis.
If you wrote code, the company isn't allowed to claim someone else did.
But remember that gets very murky when you are working in a team.
I am a software developer, so I write software. I am employed full-time by an employer for which I (usually) write code, documentation and such, and still I own the copyright to each and every line of code or documentation or whatever I write. Simply because copyright in German law is non-transferrable. Even if I want to, I cannot sign over the copyright to anybody else, hence my employer couldn't make me sign it over to him in my employment contract. Instead, there's a clause that I grant my employer an exclusive and irrevocable right to use the work I create during my paid work time in any way he wants. This effectively leaves me with the copyright, but I don't have any rights to profit off of that work anymore, so that copyright isn't of much use to me.