Suddenly appeared: This job failed because the necessary resources were not successfully created

Maybe a race condition with multiple pipelines triggering the prod-deployment job. Can you show the full CI/CD job log to better understand the configuration if-then-else path? The script section checks for a deployment.yml and it is not clear to me where it originates from, and which errors are shown in the logs additionally.

GitLab 14.x is fairly old, too. I’d suggest upgrading to 17.x and consider using the agent for Kubernetes for deployment workflows.