As described in https://tex.stackexchange.com/q/652458 , luatex loses or changes text (not formatting!) in particular circumstances. According to https://mailman.ntg.nl/pipermail/dev-luatex/2022-July/006684.html , this seems to be repaired in the revision 7531 in TL 2023 (perhaps a revision or two later). I know it's a long stretch, but I'd welcome it if, for proper testing, the fix finds its way into Debian, ideally into Debian stable, better sooner than later.