Ok. So most of these problems are related to Runner and Docker Containers for builds:
1. You can make Runner to not create cache containers with Advanced Settings and `disable_cache` option,
2. As for Git Repo, you can force Runner to retry cloning,
3. 500 with variables is new to me, let us know if you manage to get a stack trace from this error.
Kamil, GitLab CI/CD Lead