The balances function states that it's "used for local testing only". However, this function is called for live chain config too.
Either fix the comment description or refactor genesis function to not call balances in live_config (for example, by changing endowed_accounts parameter to an Option).