This looks like a POB (plain ol' bug) in the version of Swift that shipped in Xcode 14.2 and the one in the 14.3 beta 2. This following crashes at runtime (in a playground, too):
let line = "abc <"
let match = line.firstRange(of: "] <")
It's something about the final "<" in the match string.
Thanks for finding the already-filed bug. I got distracted by something else for a few days, so I hadn't filed a bug but now it looks like I don't need to.