I checked for other places where there was weirdness going on and there are more.
testing=> create temp table weird as with foo as (select name from big_table group by name) select name from foo group by name having count(*) > 1;
SELECT 23
Time: 700304.130 ms (11:40.304)
Hilariously enough 'DK' isn't in these 23.
Did initdb let me pick a locale that doesn't actually exist?
I'm beginning to feel like I need an exorcist.