He wasn't the heir. The heir was Latil's brother but her brother doesn't want the throne. That cause problems because Latil was not educated to be an emperor so some factions wanted to push sa illegitimate son to be an emperor. The reasons are because he's a guy and also their supporters want power. Latil don't want to give up the crown because it's for her and her brother. The emperor also somehow approved for her to be next in line as long as she can prove it. She studied for months I think, away from the empire(?) During that time the illegitemate son killed the emperor and took the throne
I dont understand how the son of a consort can be the heir and not the daughter of the empress wat bs