Backport #14532 into 4-0-stable

Since #14532 was a bug fix, backport it into `4-0-stable`.