The regression actually comes from XWIKI-22211 and more specifically from that line: https://github.com/xwiki/xwiki-platform/commit/dfba8556a4f8ff9b167ba4e4034e16195fd97d0a#diff-653dc296d840770ddd559c6d7cbbacbb33e146f851a9d53b18f003e96f4cea33L207