Fix #25705 Regression of #24369 There is no problem in 1.20 because there is #24459 (cherry picked from commit 67d16c653fbed71a91a288a8e08e21e8c681a003)