Like in risk mitigation, it’s a matter of evaluating the scenarii we can think of.
If all goes well, it’s a non-issue: your stocks are going up and you can sell them at a profit to pay for your taxes so you don’t need margin. If you’d use margin in this case, you may also ask yourself why you are not making more use of it on a regular basis in your regular investing strategy.
Now if stocks go down, chances are the margin requirements go up. It can be a raise in interest rates, harsher criteria to qualify (which may make you unable to get a margin loan at that specific time), it will cause your assets to cover a lesser available margin amount and, depending on how deep on margin you need to go, how many assets you have and how deep and quickly the stocks fall, could trigger a risk of margin call.
Then, it could happen in a deeper crisis where CHF would get stronger vs the dollar/euro/the currency you’re investing in. This could further cut into your losses.
Then, you could also face an emergency. Say you loose your job but the unemployment offices take time to process your claims so you have to go a few months without income. Your car could break at the same time, or you could have to face some additional health costs (which may even be the reason why you can’t work anymore).
If you can still fulfill your obligations then, then it might be a suitable strategy for you. If not, that’s a matter of balancing the gains vs the risks. I’d not do it with my emergency fund and if I was going to do it with my taxes, I’d probably be on margin as a part of my global strategy (meaning I’d use it for my regular investments, making the available additional margin for the taxes not necessarily an opportunity for more gains).