Why your Set is not deduplicating
getValues() always returns a 2D array, even when you read a single column. A call on 100 rows of column A gives you [["foo"],["bar"],["foo"]] — 100 single-element arrays, not 100 strings. When you feed that directly to new Set(), JavaScript sees 100 distinct array references, so every row survives as unique. The Set does nothing useful.
The fix is one word: .flat(). Call raw.flat() immediately after getValues() and the nested arrays collapse to ["foo","bar","foo"]. Now Set deduplicates on value equality, which is what you wanted. I have watched this bite people who swear their logic is right, because the Logger will happily print [[foo],[bar]] and it looks like a list of strings at a glance.
If you are reading a multi-column range and only want one column, slice first: raw.map(function(row) { return row[0]; }) gets you the same flat array without needing .flat(). Either route works; .flat() is shorter when the range is already one column wide.