Fixes a bug in Grid expand logic (#13334)

Change-Id: I0ec1ccc0bc88c9fac63abc67cf50f8b12013d984