It’s less about accidentally writing n^2 sorts and more about not accidentally creating n^2 algorithms.
Not sorting, but very simple algorithms that can't afford having O(n^2) performance? That's common even in CRUD apps.
Perhaps not sort so much, but certainly with search I've seen people roll their own inefficient search functions many times.
It is the exact same situation, though. Most people can just chain a sort and a binary search to do it, and both are included in most languages.
Or just put it into a tree map, if your language has it.