I think there must be something in there related to your code, I recorded many videos with OBS and never got a white line like that.
Can you try to record a cornflower blue screen in your machine and compare it?
Not sure what the original issue was. I just played with the transform in OBS and the source(s) (Window Capture) and then the recording was good and did not show a white line at the top.