When I bought my TV supporting Miracast protocol, I thought I would not need to buy a Chromecast. And it (the TV) worked beautifully with my Nexus 5 for some days. But soon, the phone stopped casting the screen on the TV. Another phone (Moto X Play) still works fine though, so pretty sure it is a phone problem.
A conspiracy theorist would suggest Google intentionally breaking Miracast support to boost sales of Chromecast ;)