Sounds reasonable. The tax authorities will also play by the rule and might tax you pro rata (e.g. for the first 3 months). Thus your reduction from 2021 pillar 3a contribution on income tax would be negligible.
Withdrawing it from abroad would expose you to tax at source from whatever canton your 3a provider is domiciled. Double tax treaty might help you recover the Swiss tax at source, while exposing you to foreign tax on pension capital. To do this, you would need to be a tax resident in the foreign country. And the profit is probably not worth your while, depending on which country you want to relocate to.
Coming back to Switzerland a few years later, you would have more wealth and pay corresponding taxes (negligible ‰). The tax authorities will not have an issue with it, I would think.
It does not sound like a fantastic game plan. Check my blog post about it: https://schweizer.pm/pri/2020/kapitalbezug-von-saeule-3a-im-ausland/