I came across this preprint that claims in Lemma 1.1 that Gelfand's trick (also known as Gelfand's lemma) only works in characteristic zero:

Let $H < G$ be finite groups. Suppose we have an anti-involution $\sigma : G \rightarrow G$ that preserves all H double-cosets. Then over algebraically closed fields

of characteristic zero(G, H) is a Gelfand pair.

It is not obvious to me where the characteristic of the ground field being zero is used in the proofs from Lang's $SL_2(\mathbb{R})$ book (Theorem 1 and Theorem 3 in Chapter IV), the introduction in this preprint, the last slides in these slides, or anything else that I've seen.

What causes Gelfand's trick to fail in positive characteristic? In this setting, the groups are finite but I would also like to know the answer for the more general versions of Gelfand's trick (i.e. also for locally compact groups with compact subgroups or even reductive groups over local fields with closed subgroups).

1more comment