Update: it happened again after updating Sequoia to a newer version.
I went into battery settings and disabled automatic graphics switching, that seems to have worked for now!