I do frequently sell to my retainer, but this doesn't seem to be the cause of it. I was having gil randomly appear before the ability to sell to a retainer was added. I also tested it, and the gil went to me, not the retainer.