Google isn’t respecting canonical tag on Discourse, that is a problem.
@EducatorWaji - Not the same case. WP category pages exist as a separate page, in this case we are sorting a list of items on the same page. Google allows either using URL parameters in search console to indicate to Google about the behaviour of this parameters (Spring cleaning: the URL Parameters tool | Google Search Central Blog | Google for Developers) and as an alternative you can use canonical.
Sorting is covered under this. But in all examples that Google gives, a ? tag is used at the end of the original URL. Hence my original hypothesis.