Sorry to hear about your problems with residence certificate.Every time I have bought a new car or sold the old one, I went to my embassy and had them issue a residence certificate.It cost a little more than at the immigration, but it is very convenient, sometime if the embassy is not to busy, I sit and wait and get the certificate same time.
Of course I don't know your nationality, if it is even possible, but I am danish and it works every time.No need for agents or immigration, where it takes 2-3 weeks just to get a letter, crazy in my opinion.For selling the old car I just made a copy of the original residence certificate, but for buying a new car you need the original certificate.