It had been previously hypothesized this might be resulting from an empire that lost all its planets but had surviving fleets, which I had tried testing for, but it seems that is just part of the story-- it turns out that the surviving fleets need to specifically include a military fleet, and even then the bug does not appear unless/until that military fleet completes/ends its current mission without having been destroyed. In this case that happened 7 turns after the AI had lost all its planets.AI_6: AI_Error: AI script error in "calculate_priorities": "Unable to find key in unordered_map."
AI_6: AI_Error: AI script error in "assign_military_fleets_to_systems": "Unable to find key in unordered_map."
Although the error then gets triggered twice each turn in not-obviously-related tasks (calculate_priorities, assign_military_fleets_to_systems), the actual error stems from the same bit of code that gets called from both places. My fix/workaround is essentially that if the AI has lost all planets it will not attempt to provide military backup for exploration efforts. I've confirmed that this fix/workaround solves the problem in my RC2 testcase and I have committed it now in master.
Regarding the question of whether to include this in 0.4.7.1, I am inclined to say it's not worth it at this point. Although the bug is quite visible when it does occur, it arises in a very narrow circumstance that seems to be pretty rare, and the actual impact is extremely minor-- the AI military fleet in this situation will wind up just sitting still and being a minor obstacle, but it is extremely unlikely that the AI in this situation would be able to accomplish much more even with the workaround in place. There is also a minor bit of conflict resolution that needs to be done to copy the commit from master into 0.4.7.1. If anyone is wanting to further consider this and test it out, I could post a PR to 0.4.7.1 in which I take care of that conflict resolution.