When diagram is located in subfolder then relative path to icon location is not resolved correctly. Or at least not in the same way as it is by VSCode extension.
Repo with example: https://github.com/miroslav-matejovsky/d2-local-icons