We need to backport https://github.com/root-project/root/pull/20645 to the v6-38-00-patches, v6-36-00-patches and v6-34-00-patches branches to fully resolve https://github.com/root-project/root/issues/20643.