Switzerland does not tax private capital gains
The Swiss starting point is remarkable and genuine: a private individual investing their own wealth pays no tax on capital gains from movable assets, shares, funds, bonds, at either the federal or the cantonal level. So a profit on selling your Indian shares or mutual funds is simply not taxed in Switzerland.
There is one boundary to respect. If your trading is so active and leveraged that the tax office treats you as a professional securities dealer, high volume, short holding periods, borrowing to invest, the gains can be reclassified as taxable self-employment income. For an ordinary long-term investor that does not apply, and the gains stay tax-free. So the tax-free treatment is real, but it assumes you are investing privately, not trading as a business.
The treaty takes India out of the gain
The second half of the good outcome is on the Indian side. Under the capital-gains article of the India-Switzerland treaty, gains on ordinary shares of an Indian company, and on mutual-fund units, which are units in a trust and not shares, are taxable only in your country of residence, Switzerland. So India has no treaty right to tax the gain at all.
That matters because the fund house or broker will still deduct TDS on your redemption at the Indian domestic rates. But since the treaty makes the gain Switzerland-only, that TDS is not a final tax, it is recoverable. Indian tribunals have repeatedly upheld exactly this for residents of countries whose treaties use the same wording, so it is a well-trodden position, though you do have to claim it, either with a lower-withholding certificate up front or by filing an Indian return citing the treaty with a tax residency certificate and Form 10F. Combine the two halves and the gain on your Indian shares and funds can bear no tax in either country.
The dividends are the exception
It is important not to over-read this. The tax-free treatment is about capital gains, not all investment income. Dividends from your Indian shares, and interest, are taxed in Switzerland as ordinary income at your normal rates, so they are not tax-free.
On those, India withholds tax at the treaty rate of 10%, secured with a tax residency certificate and Form 10F, and Switzerland relieves that Indian tax through its foreign-tax credit for the withholding. So the pattern for a Swiss resident is clean once you see it: the gain on the shares and funds is often tax-free in both countries, while the dividends and interest they pay are taxed in Switzerland with the Indian 10% relieved. A practising CA secures the treaty position on the gain, recovers the Indian TDS, and caps the withholding on the dividends, so you keep the advantage and lose nothing to over-deduction.