As long as no fraud is involved, you don’t lose your securities in case of broker bankruptcy. At least if we’re simply talking about holding stocks or ETFs without margin or securities lending, the customer securities are segregated assets which won’t be part of the bankrupt estate. While you would likely lose access to your assets for a hopefully short time, you should be able to transfer your positions to another broker in case your current broker is bankrupt.
In case fraud is involved, there is limited protection for assets held in the US and the UK, see Interactive Brokers Q&A [2023] - #20 by jay. There is no fraud protection for securities in Switzerland.