You're experiencing what many other users with M1 iMacs are experiencing.
The following topics illustrate the Silicon M1 iMac Display problem:
Screen Failure on 24-inch-iMac, M1, 2021 - Apple Community
Persistent horizontal lines appear on iMac Screen - Apple Community
Horizontal Lines on Screen of iMac, 24", 2021
Horizontal black lines covering bottom 3rd of 2021 M1 iMac screen
Grey horizontal patches on my M1 iMac 2021 model
Horizontal lines at the bottom of iMac(M1,2021) screen
Horizontal Lines on 2001 M1 iMac Display
M1 iMac Display vertex heating to scorching 55°C — Seeking Advice on Escalation
Horizontal Lines on iMAC with M1 chip
After taking their iMacs in for a free diagnostic check they found that the repair would be abut $600 US. If you happen to be under warranty or Apple Care with your iMac the repairs will be free.
Currently there is no Service Program for that issue but keep checking this website in case Apple instigates one: Apple Service Programs - Apple Support.
As already recommended take your iMac in to the nearest Apple Genius Bar for a free diagnostic check so you'll be sure to be in their database as to having the problem.
So users have considered getting an inexpensive monitor and using it as an second monitor with the iMac.
