Connecting two MacBooks over USB-C for transferring video signal from one to the other
No, target display mode doesn’t work over USB-C.
You’ll want to screen share over point to point network for this.

https://www.airsquirrels.com/airparrot/

The latency for screen sharing is very good now. You might have better luck with an iPad for this and sidecar or dedicated hardware to get it into OBS.

https://shop.astropad.com/collections/luna-display-mac-and-pc