Do you mixed the Aqua Regia with NaCl before dissolve the gold?
I think, the biggest impurity for gold is silver and copper. So, after you dissolved the gold with AR, the intention to put NaCl is to precipitate the Silver that dissolved.
So, the gold is left in the solution.