How do I change the apiVersion of an object in Kubernetes?

Thank you backwards compatibility!!!

kubectl get deployment XXX is apparently ambiguous, since the server has deployments in multiple api groups. When a resource exists in multiple api groups, kubectl uses the first group listed in discovery docs published by the server which contains the resource. For backwards compatibility, that is the extensions api group.

Try: kubectl get deploy.extensions XXX and kubectl get deploy.apps XXX to verify that your deployment actually exists in two api groups.

https://github.com/kubernetes/kubernetes/issues/58131#issuecomment-356823588