Using penultimate and latest versions of yq on macOS 26:
❯ ./yq_darwin_arm64 --version
yq (https://github.com/mikefarah/yq/) version v4.49.1
❯ ./yq_darwin_arm64 .foo=42 <<<""
foo: 42
❯ yq --version
yq (https://github.com/mikefarah/yq/) version v4.50.1
❯ yq .foo=42 <<<""
foo: 42
This does not happen with -n: