This is due to hardcoded color and subdivision value. Also scale and offset properties stored in overlay stuct was not considered. Now multiply the transform matrix with `grid_mat` to make use of these properties. Pull Request: https://projects.blender.org/blender/blender/pulls/134382