Signed up to the forum because this issue just happened to me last night. After searching the internet, I found this thread as well as others with this same issue. I just bought a 14" Macbook Pro M2 Max and after a few hours of use setting up it up, my LG 27UN850-W which I bought a week prior started flickering with vertical lines. At first I thought I bought a defective monitor but it was previously connected to a 2020 i7 iMac using a thunderbolt 3 cable with no issues.
I am using the same thunderbolt 3 cable to connect to the monitor and wasn't sure what triggered it to start flickering and getting the lines. I kinda freaked out last night because all components are new except for the thunderbolt 3 cable which I bought in 2019.
I also have my PC connected to the monitor via display port and I turned off the Macbook and started that up the PC. There was a slight flickering but it went away over a few minutes. I didn't turn on the Macbook after this until this morning where the problem went away. I am not sure what the trigger was but hopefully I can figure out what the trigger was to prevent it from happening again.
EDIT: I was able to replicate the flickering and the vertical lines. It was YouTube ambient mode videos that had dark backgrounds with flashing bright elements. The outside of the video play area emulates lights and colors behind a screen effect like what you would see if you install something like a Govee TV backlight. My browser (Firefox) didn't handle it too well and that was causing my monitor to freak out. I can't say 100% that was the cause from the first time it happened but once I turned off ambient mode, the flickering and vertical lines stopped. Hopefully this was the fix for my issue and it helps someone else.
Edit 2: Monitor problems came back again but this time, I had my Macbook in clamshell mode. I walked away from my desk for a bit an when I came back, this time, along with the flashing and vertical lines, the monitor had some image burn in. I had nothing playing just a browser window with just the YouTube home page. I tried power cycling the monitor and trying the same thing I did with my PC but that didn't work. I then searched for IPS monitor burn in fix and I went to a YouTube video that played some random white flashing (
). I played it at full screen for a good 20 minutes and the problem went away! No lines, flashing or burn in. This is staring to get annoying and not sure what to do as I can't randomly stop working to have that video play for 20 minutes to fix the screen. I am planning to get a Thunderbolt 4 dock and maybe that might help but not sure if that will prevent the external monitor issues in the long run.
Edit 3: This time, Adobe Illustrator triggered the flashing, lines, etc. I did the IPS video fix then confirmed again with Illustrator and yup, was able to replicate the problem. Seems to be an issue with GPU acceleration option.