My maths or coding isn't good enough for this sorry. I did manage to recreate the calculations in Excel using the method from mosaic.cpp and found I got the wrong RA value as well.
I can say adding the width of the sensor, minus overlap (in degrees) to the RA position (degrees) gives the wrong position, though this method works for DEC.
I had a look at how
Telescopius
do their mosaic tool ((
pastbin
) and they do some spherical and cartesian coordinate conversion - perhaps that's a hint for you.
I'll keep giving it some thought, and hopefully someone can assist.