I don’t know about dangerous, but case-insensitive Unicode comparison is annoying, expensive and probably prone to footguns compared to a simple byte-for-byte equality check.
(And yes, all modern filesystems support Unicode. Linux stores them as arbitrary bytes, Apple’s HFS uses… some special bullshit, and Windows uses UTF-16.)