(Sub Component is wrong, this is not about GTS, but Bugzilla won't let me select anything else.) When using -static-libgfortran, libraries implicitly added by the driver should be -static-lib*. For example, using -static-libgfortran should result in using -static-libquadmath, not the dynamic version.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (devtoolset-12-gcc bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:3272