Okay, i’ve got a 2nd patch for you that fixes it on my reproducer. Its a bit longer than i was hoping, and i had to make a katello 4.2-specific version of it. The 4.2 pr is here: https://github.com/Katello/katello/pull/9747/ and i split out the test fixes for easier applying:
Note, i would recomend reinstalling the tfm-rubygem-katello package to remove any previous patches:
yum reinstall -y tfm-rubygem-katello
wget https://github.com/Katello/katello/pull/9747/commits/fff3e1aa2cc1e9fd582783327a20fa06a09af1be.patch
patch -p1 -d /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.2.0.1/ < fff3e1aa2cc1e9fd582783327a20fa06a09af1be.patch
systemctl restart foreman dynflow*