I really can’t remember cuz I’ve read it form over a year ago but I’m pretty sure the ritual is supposed to wipe his memory, which is what they call “cleanse”. Idk if you’ve seen the spoilers, cuz I left quite a detailed one in the comment too but this is some because anytime na-in acts out like that, that means he’s already regaining his past memories which is what Amon doesn’t want.
If he regains them all, he would most definitely run cuz in his memories, Amon was soo so horrible to him, he literally almost killed himself. He ran away from him multiple times. Also another symbolic gesture that shows that he was regaining his memory cuz that form of Amon (his true form, dragon) is something that na-in had seen and had haunted him.
Because I can’t remember the details specifically, I would like you to take this with a grain of salt. The last part of what I said is what I can’t remember the most, but those dreams were a part of na-in’ memories pretty sure.
Also na-in resorted to killing himself cuz he couldn’t take all of Amon’s shit and that was when the priest advised that they should do the memory cleanse, so it helps na-in avoided suicide.

Can someone pls spoil the ritual that is happening? What exactly is happening, why did they recite all that, y did the priest take a knife out. Etc. I know the ending and other spoilers, but i want to know how the ritual works