This is a known feature which has been around since day 1 and is a performance mechanism. It has been extensively documented in the past.
The solutions is very simple, apply a default formatter to the column to add an empty string and it will sort correctly.
See Productivity Tips & Tricks
Tip 1