JSON-LD is also much easier to generate in scenarios where you can access post meta data and output scripts but can't necessarily filter HTML markup output (WordPress, corporate CMS, etc.).
A lot of websites are now generated using static site generators and it is much easier doing so inline, than have to duplicate the content which also makes the pages much bigger. Like I said the issue is more about lack of transparency about how it may effect ranking.
And you can generate it dynamically: https://developers.google.com/search/docs/guides/generate-st...