They do. They are generally not the FM of Scotland and leader of the party of the person under a live investigation.
I doubt the law on contempt would make a distinction as it applies to all equally.
I fully accept that politically (rather than legally) it is in Yousaf's interests to say nothing noting that saying nothing will both ensure he is well away from any legal line on contempt, but also noting that his 'silence' speaks volumes, just as Sturgeon's did when Salmond was the subject of a live investigation.
Point is that there is plenty that a politician can say during a live investigation that would infer a broad support for the individual (while of course not making any specific claims about the matter being investigated). A decline to support, couched around 'inappropriateness to comment' remains a decline to support.