GitLab's opinion of what constitutes valid YAML differs from the official spec. Booleans, in particular, are problematic.
According to the spec, boolean values are English words:
False, and so forth. GitLab disagrees[^gitlab-issue], and only recognises the invalid value
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.
[^gitlab-issue]: There's an open issue related to this bug. It doesn't look promising.