Heterogenous 5G wireless Sensor Networks face several constraints throughout the routing process. Reduced costs, minimal energy use, and reliable data transmission between nodes are the primary problems of a heterogenous 5G wireless sensors network. During the transmission process of nodes, vacant holes use the most energy. The two most problematic aspects of heterogenous 5G WSNs are the location mentioned above mistake and the battery drain on individual nodes. However, the network's performance suffers significantly due to data packet loss and excessive energy consumption. Thus, many routing protocols incorporate various energy-saving techniques. In contrast, a routing strategy is suggested in this research to prevent void holes and maximize network stability. In addition, the scalability and efficacy of the proposed protocol are demonstrated by comparing it with state-of-the-art protocols. This study also introduces the idea of location error to increase the network's efficiency. In addition, a scalability study of the suggested systems has been conducted. Extensive simulations were also conducted to evaluate the effectiveness of the proposed technique. The findings confirm that the recommended routing strategy outperforms the competing schemes.