Have you considered validating your YAML against a schema? JSON Schema[0] can do the trick, and has decent editor support[1].
It's not a panacea, but it can help avoid those long debugging sessions.
[0]: https://json-schema-everywhere.github.io/yaml
[1]: https://marketplace.visualstudio.com/items?itemName=redhat.v...