There are a couple of things to point out. Firstly, Arm64 isn't supported on Azure Arc agent. So if your Ubuntu VM is arm64, that could one explanation. Another callout is the extension itself doesn't support SSH proxy on an arm64 client machine. The reason it works locally is because on the same network, you're not going through a proxy.
The best thing to do is use the --verbose
command to see which area of the extension is sourcing the error.
EDIT 31 October 2023
After further investigation, this may be a regression bug. It's actively being tracked here: az ssh: unable to connect from client with ARM processor · Issue #6925 · Azure/azure-cli-extensions (github.com)