UTF-16 has some special ranges assigned to it known as surrogates. If they appear as a dchar it is rightly an error. The lexer should when it sees this range, should error but hint that what you tried to escape was the wchar's as if they were dchar's.
@rikkimax created dlang/dmd pull request #17047 "Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error" fixing this issue: - Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error https://github.com/dlang/dmd/pull/17047
dlang/dmd pull request #17047 "Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error" was merged into stable: - 6fb4da37daaf1767b78b1bc0791591dcf8c2dfb8 by Richard (Rikki) Andrew Cattermole: Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error https://github.com/dlang/dmd/pull/17047
dlang/dmd pull request #17069 "Merge stable" was merged into master: - b11b3f3bfa8d8fd1dd9413bb97d044855aef7613 by Richard (Rikki) Andrew Cattermole: Fix bugzilla issue 24841 - UTF-16 surrogates when used as an escape of a string should hint on error https://github.com/dlang/dmd/pull/17069