This fixes a regression from refs #25496. Backport of 1155843a41af589a856efe8e671a796866430049 from master