Refs #27458, #27843. Thanks Tim and Mariusz for the review. Backport of ee85ef8315db839e5723dea19d8b971420a2ebb4 from master