bIncludeForcedGold is only set to true if it's turn 40 or later. So this assumes that the Khazad will have a capital city after turn 40. Unfortunately, there are three circumstances where this might not be possible:
1. If the game has Require Complete Kills turned on, with a Khazad AI that has lost all of its cities. (This is pretty unlikely, but not impossible).
2. If the game has a Khazad AI that has not yet settled by turn 40 (Even less likely to happen).
3. If the game is a scenario where there is a Khazad AI with no cities (like Dungeon Adventure, would only happen in modmods).
This can occur in any game (although, as you said, rarely) so it definitely needs to be fixed. I haven't had it happen to me (yet), and I don't think it's been reported, but someone is bound to experience it eventually.