I see this commit started to refuse SORT command on replicas:
989528f
This doesn't seem right. We can use SORT in replicas, the replicas just need to be set as writable.
The fact that SORT is a writable command and had no SORT_RO was fixed in Redis 7 only.
In summary, SORT is a valid command on replicas, in any redis version that the command exists, it's just not valid on READONLY Replicas