GitLab’s opinion of what constitutes valid YAML differs from the official spec. Booleans, in particular, are problematic.
When in doubt, run your
gitlab-ci.yml file through the GitLab linter. Also do it when not in doubt. The alternative is to only discover the problem when your CI pipeline fails.