Found new virus

Hey ! I got an infected Qmobile , CM2 AV detected 9 viruses .
After clean then and clear user data option phone was still infected
I tried a few times but no success . I tried with miracle box and merapi tool as well but they also failed to kill the viruses .
Virus , error , " (system need to be updated)"
I already had full factory file for this model. I tried to re flashed that system image but after some percentage phone showed changing
I tired to flash with all available tool but same problem .
So finally I gave back the mobile to customer.
Reason to write this post I need some opinion from good flashed for next time ,
What was cause and what did I wrong and what should I done in this kind of cases
May be I get same case next time . Thanks

Sent from my iPad using Tapatalk