I have following RPC code. It runs on local fully synced bitcoin core node.
You'll have to be a little more explanatory. Where is this code from? Is it yours? What's the library you're using? Judging by the fact that it's C#, may I suppose it's NBitcoin?
For example for address 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa it returns 22.73242908 BTC, instead of correct 72.74245948 BTC.
That particular address is the exception to the rule, because it was rewarded with the 50 non-spendable bitcoins of the genesis block. The correct amount of spendable coins is 22.73242908.
Judging by the code, it gets the total balance by summing the UTXOs. Since the block reward of genesis isn't UTXO, it doesn't count it.