Are you reproducing the hang locally with my repro? Or do you have your own repro? How are you testing pg_terminate_backend() and seeing that the InterruptHoldoffCount is 1?
I noticed this problem occurring several times on PG16, but I didn't use your repro, and haven't found a way to reproduce the problem. Instead, I simply force the vacuum to enter a retry loop with the following code and found InterruptHoldoffCount is 1.
// if (unlikely(res == HEAPTUPLE_DEAD)) goto retry;
Sorry, I should have mentioned that patch was against REL_14_STABLE. Attached patch has the same functionality but should apply cleanly against REL_15_STABLE.