There is a limit if you want USB PD charging and full speeds:
https://www.cablematters.com/Blog/USB-C/how-long-can-a-usb-c-cable-be
And as it relates to Thunderbolt 4 / USB4:
I wanted a long (>2M) Thunderbolt 4 cable for something else and the only game in town is Apple’s very expensive 3M TB4 Pro cable for $160. I did end up shelling the bucks but I wasn’t thrilled about it.