That’s a common issue in NMAP itself. It can only infer hostnames when the target responds with something readable, like responding with a NetBIOS name to Windows shares or host headers on a website or something like that. Most modern Windows versions won’t provide that to an anonymous scanner these days, and may not respond at all given default Windows Firewall rules. In many cases all NMAP can get is that “a thing exists” based on ARP replies.