Hi @Corissandageri,
Could you share more error information?
I also made a test on the following codes, I think it can meet your needs and work well.
Sort(Distinct(Filter(Table4,QuantityO<>QuantityRO),OrderNumO),Result)


Please ensure the DisplayFields property is ["Result"].
If this doesn't meet your needs, please share more about your requirements.
If this doesn't work without any error, please create a new app and try again to check if the issue is fixed.
If there is any error message, please share it with screenshots.
Best regards,
Sik