Many people explained it better than I ever could, so let me defer to them. TL;DR: YAML is an overcomplicated spec with too many footguns.
- https://ruudvanasseldonk.com/2023/01/11/the-yaml-document-fr...
- https://www.arp242.net/yaml-config.html
- https://noyaml.com/ (couldn't not mention this famous piece)
I have always preferred (even without thinking) to use configuration files as Yaml and kept Json for interprocess communication