Ok,
In case of external this might be happening.
I think on outsystems application entities, collation is case insensitive by default, but in external databases another choice could have been made.
Maybe you can experiment with adding UPPER() or an explicit COLLATE section while building your TableSort string.
I´ m not sure the latter would even work, never tried it.
Dorine