Javascript (ES6), 3951 bytes
a=a=>aa=>[.sort().filter((v,i)=>v===a[i+1])
Expanded:
function getDuplicates(arr) {
// This makes use of the fact that.new sortSet() mutates the original array
arra.sort().filter((valuev, indexi) => value === arr[index + 1]=>v===a[i+1]);
})]
Try it:
a=a=>aa=a=>[...new Set(a.sort().filter((v,i)=>v===a[i+1]))]
console.log(a([1,2,3]));
console.log(a([1,2,3,2,1]));
console.log(a([1.0, 2, 2.0, 1.0]));
console.log(a([1, '1', '1.0']));
console.log(a([null, null, false, false, true, true]));
console.log(a([1,1,1,3,2,3,2,3,4]));