I renamed my Pi4 to raspberrypi4.
If I connect to my lan using wifi the hostname is given as RASPBERRYPI4 and an IP address is assigned.
If I connect to my lan using a network cable the hostname is as RASPBERRYPI and a different IP address is assigned but the wifi ip address is removed. Internet connection works when connected to wifi but doesn't work when the ethernet cable is plugged in.
These are the hostnames given in the router interface not on the raspberry pi device configuration dialog which stays at raspberrypi4.
I am using the Pi as a plex server so obviously an ethernet connection would be preferable to wifi.