you can solve this issue by using
GridAlpha — Grid-line transparency 0.15 (default) | value in the range [0,1] Grid-line transparency, specified as a value in the range [0,1]. A value of 1 means opaque and a value of 0 means completely transparent.
Setting this property sets the associated mode property to manual.
Example: ax.GridAlpha = 0.5