uniq combines adjacent identical lines. It doesn't search the entire file for earlier copies.
Sorting first brings equal records together; sort -u is another valid approach when only distinct lines are needed. A count with uniq -c answers a different question and is useful when frequency matters. Check whether the request asks for records, distinct values or counts. Those outputs can all look plausible while containing different information.
Sort order also depends on the data: ordinary text sorting places 12 before 3, while sort -n compares numeric values. Keep the output file separate from the input when redirecting a sort. The shell would otherwise truncate the source first. After deduplication, inspect the remaining lines as well as their count.