If you will stay in CH until age 60 then it makes sense. If you leave CH earlier, you will need to plan how to get the money out without potenitally paying more taxes in your destination country than you initially save in CH:
If you invest in 3 pillar now you will get ca. 17% of the amount invested as a reduction in your 2021 tax bill. If you are still resident in Switzerland at age 60 you can withdraw the 3rd pillar at a reduced tax rate. https://finpension.ch/en/capital-withdrawal-tax-compared/
If you leave CH before withdrawing the funds the payout may be taxable in the destination country depending on the Dual Tax Agreement between CH and that country
In your case if you do leave Switzerland the plan to get the money out might be to change from “employed” to “self employed” the year before leaving?