I think the formal reason (paraphrasing @betanalpha as I don’t understand this myself very well) is:
Stan is built to sample in spaces isomorphic (topologically) to \mathbb{R}^N. There is no such isomorphism between unit circle and \mathbb{R}. Informally, the problem is that mappings between the unit circle and \mathbb{R} must introduce a “break”, so points with angle just above 0 relative to the break do not map close to points with angle just below 2\pi relative to the break.
This also explains why this version can sometimes work: if your posterior is negligible around the break, the break will not be encountered during sampling.
The linked approach (if I understand it correctly) avoids the problem by realizing that one doesn’t need to treat the angle as a standalone quantity. Instead, one can treat angle and amplitude together - basically by taking cartesian coordinates in \mathbb{R}^2 and converting to polar coordinates - which brings you into the type of space Stan can sample without issues.
Does that make sense?