Stop app from showing multiple icons in Dock is showing up multiple times in the Dock. It's only open once. How do i stop this?

I have opened an app once, but it shows up two more times in a different middle section between two lines.



Is this an app misbehaviour or an macOS one? I can't tell and I'm not sure where to troubleshoot. This is the only app it happens with.
Apps with support for opening documents minimize into Dock in their own separate icon. To disable that behaviour, check Minimise windows into application icon under System Preferences → Dock.

macOS Mojave has a configuration to show recently used app's icon in the Dock (just like in iOS 11 and later). To disable it, uncheck Show recent applications in Dock under System Preferences → Dock.