Refer to this thread. It seems Postfinance may let you withdraw 3 pillar whilst still a Swiss resident if the paperwork has been stamped by your commune. I have no data if this is possible for 2 Pillar.
Another option would be to move the UK, the UK CH double tax treaty says the pension would not be taxable in UK, you only have to pay withholding tax in CH. I am sure there are other counties, for 1M taxable it would be worth it…