Foundation Season finale critique — SPOILERS

Laura Birn in “Foundation”, now on Apple TV+.
Haven’t watched the season finale of Foundation season three? This will spoil it, stop reading!
Considering Demrezel is a robot, her demise being illogical disappoints me. In the scene, she finds herself in a situation the writers made look like a choice between saving herself or the infant Empire, Dawn. In the same scene, they show that self-sacrifice did not and could never have saved Dawn, as she melts and Dawn dies anyway.
The writers made Demrezel, a robot, act illogically and at the same time disobey her directive. To obey her directive and ensure the continuation of Empire, her priority should have been Day, whom she knew to be vulnerable without an aura or nanites. Although cold-hearted, following her directive should have meant crossing through the beam, as she clearly could have, and killing Darkness. As a result, Day would have ascended to Dusk, but ruled until a new Dawn was ready for ascension to the middle throne.
I really liked the character of Demrezel, and Laura Birn’s acting was superb. I hope the show’s hinting that her consciousness may have survived, either in the Prime Radiant or in the remaining part of her skull, means there is a chance Demrezel’s death is just what her former religious belief suggested: Rebirth.