My question is, after everyone forgot about Xu Qi An, it's said that Wei Yuan/Wei Gong died fighting the sorcerers,…
I also just finished and don’t know about the novel. But when the Astronomy Bureau gets the Alchemy book in the end, it says that it has the power to even bring back the dead. And then the body gets delivered to the bureau (Xu Qi An specifically asked his dad to retrieve the body, if I remember correctly).
So I think they will bring him back to life.