This:
Share the screen of another Mac - Apple Support
It will be laggy.
There are some third-party software solutions posed in this forum section but I have not used them and do not have links. I hear they are also laggy.
Basically NO new Mac you buy today will support Target Disk Mode. Even the few remaining Intel-powered Macs ship with too high an OS that cannot be downgraded to Catalina. Apple began the deprecation of Target Display Mode in late 2014 and threw the last shovel of drive in its lifeless face in early 2020.
If any employee, Apple or otherwise, told you this would work, you need to address that with the store manager. With a print-out of the TDM system requirements at hand,
If you bought the computer directly from Apple, either at an Apple retail store or the Apple online store, you have 14 days for a no-questions return. If you bought from a reseller, the reseller's return policy applies.