I don’t follow this math. So you go to Portugal with 30% less salary, pay taxes on that and still come out with the same net as in Switzerland? either you are paying way too much taxes in Switzerland or you found a loophole in Portugal
Not directly your case. But if you retire in Switzerland and you withdraw your pension money as a lump sum, you can only do buy-ins until three years before you retire. From a legal perspective I would therefore argue that such a 3 year period would also apply to withdrawal due to emigration. I don’t know if there are specific laws. You could claim that you didn’t know that you were leaving Switzerland at the time of the buy-in. Still, tax authorities might ask questions.
And same goes for withdrawing 2nd/3rd pillar for primary home that becomes secondary/rental soon after. That’s illegal.
Wouldn’t it be better to obtain Swiss nationality before leaving (assuming Portugal allows dual nationality)? If you hold a C permit and are planning to leave the country in 1–3 years, you may already be close to the 10-year threshold required to apply for Swiss citizenship.
That will guarantee you to return to Switzerland as you like, without the need to buy a property
The problem might be that the process itself takes 2/3 extra years (for whatever reasons) and depending on the canton means not moving around Switzerland for years before/after.
Probably doesn’t fit the timeline.