I had a software called spacedesk which, allowed me to use my phone/tablet as an external display.
As soon as I uninstalled that, everything started working fine.
Please check if you have any software such as what I was using, and try again. Phone itself is most probably fine.