The debugedit and find-debuginfo components were split off rpm and turned into their own upstream project and RHEL9 package debugedit. Although debugedit is part of RHEL9 now (AppStream debugedit-5.0-3.el9) rpm still ships and uses its own copies (see /usr/lib/rpm/macros %__debug_install_post).
Fedora has been changed to use %__find_debuginfo /usr/bin/find-debuginfo
It would be good if RHEL9 could do the same because bugs are being fixed in (upstream) debugedit and not in rpm for these components.
Change in rpm 4.16.1.3-24.el9 breaks build of gcc-toolset-13-gcc because location of find-debuginfo uses %%{_bindir} and doesn't expand that to /usr/bin. When scl package mangles _bindir to point to scl root it can't find the script in scl directory.
Simple fix would be to change the sed to:
-sed -i -e "s:%%{_rpmconfigdir}/find-debuginfo.sh:%%{_bindir}/find-debuginfo.sh:g" macros.in
+sed -i -e "s:%%{_rpmconfigdir}/find-debuginfo.sh:%{_bindir}/find-debuginfo.sh:g" macros.in
That is to hardcode the location of find-debuginfo.sh in macros.in so that change of %{_bindir} doesn't change location of script.