If I take your screenshot png with the visible grid lines and record this with my OBS Studio (inserted with media source), I see the grid lines perfectly fine with playback. So it might be your issue is not with recording but with playback - with your media player. I used no special settings - it's all the default settings with color format NV12, color space 709, color range partial and quality "indistinguishable".
No attempt to record anything near lossless.
Try a different media player, and play the video real fullscreen. If the media player downscales for a smaller display area, it might be the thin grey lines are eliminated with that downscaling.
I use Media Player Classic, and this player is able to downscale even these thin lines fine: