Fix bug in the `diagrams` tool when generating cross-referencing diagrams for parametric entities