On and off ghost touching and unresponsive right side of screen
A few weeks ago, I dropped my iPhone SE (2. gen) and a couple of thin vertical lines appeared on the right side of the screen. Whenever I touched the right side, it would spaz out by clicking and dragging up and down rapidly everywhere on the same side but not really responding to my exact touch. Other than that, it would register my touch even when all I did was hover my finger above the right side of the screen. I've attached a picture of a test I did, drawing a line from the left to the right side.
I decided to do a factory reset, and for a moment the problems went away. A couple days later, it started happening again. It went away yet again after a couple of days, and nowadays it occurs only every so often. When the problem returned (lasts two days typically), locking the phone and opening it would make it go away for a minute or two (during the two days in which it persists). What causes this and is there a permanent fix? At first I thought that I broke some hardware in the phone when I dropped it, but the factory reset fixing it momentarily made it seem like it was a software problem. Before the reset, the problem persisted at all times.
Thanks for you help!