[1.6.x] Fixed backport of #20740