Yes, you are right that I just needed the basic window function. I must have been confused because I was using percentile_disc() and assumed I would be using the same WITHIN GROUP syntax.
Might it be worthwhile to include a suggestion in the error message and/or documentation "Use of percent_rank() WITHIN GROUP is a hypothetical-set aggregate function. If you do not intend to use a hypothetical-set aggregate function, try using a window function with PARTITION BY instead of WITHIN GROUP"? Not sure if that aligns with your style guidelines, but just a thought.