The problem was that I was using an old version of argosd? namely version 2.12.2
enter image description here
The function toYamlPretty requires version helm 3.17, and its support in argoсd was presented only in version v3.0.11.
In my case, the solution was to update the version of my argoсd
https://github.com/argoproj/argo-cd/blob/v3.0.11/hack/tool-versions.sh