Yes, this is usually a hardware issue. There are sometimes graphics switching options in the settings/preferences you can use to switch to a different onboard video that can sometimes improve matters.
If the issue broadcasts to an external display you know it is the graphics chip(s).
If the issue is strictly with the onboard display, it usualy is the inverter cable.
The Macbook Pro is not a tablet. People have been known to exceed the hinge's tolerance for pushing the display back and damaging the cables going through the hinges. Drops or bumps that suddenly jolt the cables in the hinge can also cause this problem. I saw many Macs suffer this problem that were shipped back in bubblewrap instead of in their original egg carton like shell that was in the Apple box that came with the Mac when I had laptops return during COVID to my office. Apparently the innertia in the delivery truck was sufficient to jolt the inverter cable to the point of being damaged.