I removed all additional entries for my clients from the hosts file to the custom.list file. So I am able to edit them in the pi-hole webui under „DNS Records“.
Now all client names are still resolved in the statistics - that was easy and looks as usual. But NOT in the long-term database statistics, only the IPs are shown here!
I don't think that it's related, but you have a duplicate IP in your hosts file which can cause issues with some functions.
Change the last line to 127.0.1.1 raspberrypi which matches the Raspberry Pi OS default: All 127/8 IPs are practically loopback IPs, so nothing changes about the result of using that hostname.
But maybe long term entries/IPs shouldn't be translated to a hostname.
As IP address assignment can change, there is no guarantee that an IP observed in the past is still assigned to the same host network interface as today.
In the router I have set all clients to fixed IPs.
These IPs and the clients were also listed in the hosts file like:
192.168.178.100 iPhone
192.168.178.110 iPad
...
Result:
All clients were visible with this name in the Pi-hole statistics.
Moving these lines to the custom.list file results in the described behaviour. Only all localhost PTR queries are displayed as „localhost“.
I only want to do this to see all names in all statistics, instead of the IPs (like most users want I think), and to use the webui for editing these lines.