FWIW this was some very strange buggy behaviour that I managed to solve after much frustration.
Behaviour: I installed Dragon plus dragonfly on a backup machine with very similar specs to my primary one, running Windows 10. Just running plain Dragon, when I dictated into an IDE like this message it would not dictate the text.
If I repeated this test into notepad it worked perfectly. There were some knock-on effects as well when using dragonfly and it was also struggling with numbers in the IDE. No messages or crashes, it simply wasn't recognising the text.
Out of frustration I tried installing Serenade.ai to see how it's coming on. On my buggy backup machine Serenade was also acting strange in that it wouldn't connect to recognise apps such as Google Chrome, Visual Studio Code or Jetbrains.
Dragon help: I contacted Dragon and used Microsoft One note as the example for rich text input, as I knew they would balk if they got mention of an IDE. They simply said it's not a supported application, and even though my setups are almost identical they could be different behaviour from machine to machine.
Solution: the new backup PC was running on default Windows 10 graphics drivers for my Nvidia GT 1030, without any obvious problems. I installed the manufacturer graphics drivers, updated and both problems have been resolved.