Remote-SSH fails when running ProxyCommand

Seeing the following error when trying to remote ssh using a proxy command. Connecting to the same host works on vs code though

[Trace  - 17:00:12.322] Spawning ProxyCommand: [redacted]
[Error  - 17:00:12.437] Error resolving authority
Error: Premature close
	at new NodeError (node:internal/errors:405:5)
	at Socket.onclose (node:internal/streams/end-of-stream:154:30)
	at Socket.emit (node:events:514:28)
	at Socket.emit (node:domain:489:12)
	at Pipe.<anonymous> (node:net:323:12)

running the proxy command works on my terminal. i suspect cursor doesn’t run it in the same environment of my terminal. is there a way to change that?