Push failed with connection termination

I am constantly getting this error while trying to do realm-cli push --yes when making a function change.

push failed: upstream connect error or disconnect/reset before headers. reset reason: connection termination

I have also tried changing the function in the Realm UI and then doing a realm-cli pull, but the pull gets the old function source still. I recently updated mongodb-realm-cli to version 2.1.0 could that be part of it?

I’m able to push hosting changes with --include-hosting and no changes to my functions. It seems only my function changes cause the error.