I found where the problem is: issues with mDNS (Bonjour, zeroconf) and DHCP lease times These by themselves are not the issues, but the way iOS and tvOS have implemented these protocols.
My mikrotik router is setup with DHCP dynamic and static lease times of 5 min i.e.; after every 5 minutes, the IP lease expires and host will request for reneewal. And i had implemented an mDNS reflector on Raspberry Pi, Mikrotik do not implement mDNS, i needed that for Airplay to work between IP address subnet pools. Other router brands implement mDNS service by default.
The iOS and tvOS see two host-names on local DHCP and mDNS with same mac ID and same IP address, and to get around this these OS'es append a random number within parenthesis to set a unique host-name within the device.
I have stopped the mDNS reflector service on my raspberry Pi and this constant renaming (in my case every 5 minutes) has gone away. I could have also increased IP lease times to 24hrs, but then the renaming would have still occurred after 24hrs, when the IP address lease would have renewed.
My suggestion, disable mDNS (Bonjour, zeroconf services) in the home router for the IP subnet pool in which these iOS and tVOS connect, if you can. We don't need mDNS for airplay within the same IP subnet. Most routers available for home use, may not have this settings user configurable on router config web portal page. So i don't know if there is a user side fix for this until Apple fixes this bug in their iOS and tvOS.
Hope this information helps other affected users.
P.S.: iPhone 14 Pro iOS 16.0.1 and AppleTV 4k tVOS 16.0 are also effected by this bug.