Someone on Reddit asked Ari Aster about this in his Reddit AMA:
The more I think about it, the more it seems that Annie’s actions while “sleepwalking” are directly opposing the resurrection of Paimon. For example, the whole thing with the paint thinner; killing Peter and Charlie ruins the cult’s plans for Paimon’s human host, and by killing herself, Annie would end any chances of Grandma having another potential male host in her bloodline (assuming that the host must be from her bloodline).
Anyway, my question deals with what you intended those actions taken by sleepwalking Annie to mean. Is it just a simple subconscious retaliation against this ancient evil? Or maybe divine intervention, not unlike the Greek tragedies that this film is evoking?
He answered:
I like the idea of divine intervention, but I saw it this way: Annie knows on some buried, suppressed level that her life is not her own, and she is the victim of unthinkable, Machiavellian scheming by her mother. But she cannot look directly that this (let alone inquire about it). It would destroy too much of her inner structure. So, she lives in a kind of denial.
But in her sleep, this part of her is acting out. She tried to set fire to her children to prevent the "resurrection of Paimon," as you say. She even says, in the dream sequence, "I wasn't trying to kill you, I was trying to save you."
That said, it could also be read as Annie's buried desire to kill her children taking hold. After all, she never wanted to be a mother. All her life she has simply being doing "the done thing." The role of a mother is never one she felt comfortable playing.