I recently looked into the issue of HMD's Nokia phones apparently not supporting Miracast. This is a feature that many people want (and expect) their phone to have and it's very surprising to them when they discover that it doesn't work on a Nokia.
However, no Android One phone have been certified for Miracast, which suggests that HMD are capable of enabling this support but chose not to do it for Android One phones. Then, very unfairly, they disabled the Miracast support in the Nokia 5, 6 and 8 even though these are not Android One phones!
We know that Google removed Miracast support from Android to promote their proprietary Chromecast solution. This makes business sense for them - they have a near-monopoly on smartphone OSes and they want to use that to force people to use their services with their other devices too: If people need a TV to support Chromecast to be able to cast to it, then the TV manufacturers will need to pay Google to certify it. I don't like this business practice (and in the EU it may get challenged, I don't know about elsewhere) but it is what they are doing.
However, why do HMD have to support this anti-competitive practice by Google? Is Android One so strict about what is supported and what isn't? What do HMD gain from this? Personally I think HMD would be better off adding support for everything which they think the customers want and wait for Google to challenge them instead of being overly cautious and not supporting these non-Google things.
It appears that Miracast may get reenabled in HMD's non-Android One phone when they are updated to Android 9, but we need to wait and see. If you have a Nokia 5, 6 or 8 and you need Miracast to work then I suggest contacting support directly to encourage them to reenable this feature.