The issue seems to not reproduce on XWiki 15.5.3 or 15.19 with Java 21
I guess it means applying XCOMMONS-2671 (I guess we could even jump to XCOMMONS-2781 if it does not cause too much dependency problems) should fix it.