Alright so as long as I am registered in a high tax EU country I wouldn't gain anything (beside paperwork)
Not without substance, and even that isn't without risks.
The corp tax in cyprus is 12,5%. The dividend tax would be 17%, and I still would need to declare it as income in my home country in the EU and pay additional tax on it. (correct?)
Sort of correct. The 17% tax isn't a dividend tax. It's capital gains tax, and it's the recipient that's liable for it, not the company.
But as you point out, the company is still tax resident where you live. So the question is simply whether you pay the remainder after removing 12.50% as tax credit, pay nothing in Cyprus and everything where you live, or if you are stuck with double taxation (which is fortunately a rare circumstance for intra-EU).
The "solution"
Get the Non Dom status (deregister in my home country) and pay 12,5% corp tax and 0% dividend tax.
This would work. Note that there is a 2.6% social security contribution due as well, but it's capped at 4,800 EUR/year contribution so if you make more than around 180,000 there is no further contribution.
Problem, I can't do it yet, still 4 years tight to this high tax shithole.
Then you have no legal options, unfortunately. Plenty of illegal but with increased automation in tax law enforcement, the risk of getting caught goes up year on year.
Btw once I would get a non dom status in cyprus, I could also move my stocks with me and wouldn't need to pay anymore any taxes on dividends and capital gains, right?
As long as you get the non-domicile exemption, you don't have to pay any SDC (capital gains tax) for the first 17 years of residence in Cyprus.