Thank you for both catching this bug and fixing it in such short order. I think this is the second jointcal error you caught me out on.
Copying some of my github comments here for posterity, but you're good to merge:
That the dist_rms_relative increased for some tests is surprising to me. As we talked about on the phone, that might still be ok with more constraining refcat uncertainties given that different outliers were also rejected. This brings up a good point as to whether I should have a different outlier rejection threshold for RefStars vs. MeasuredStars (we only want to reject refstars if they're clearly bad, i.e. incorrect matches).
The new difference between the rank update and no rank update CFHT tests concerns me, but looking at the logs doesn't show anything particularly amiss (rank update version took two "outer loops" vs. one for no rank update but that doesn't necessarily mean anything). I would expect for well formed (nearly linear in the fit parameters) input data that there is almost no difference with that setting turned on. With no rank update the refcat relative and internal "absolute" astrometry is very slightly better; I don't know if that is telling us anything useful on this small amount of input data.
I wish I had a way to compute or visualize just how close to "near linear" the chi2 space really is. I'm sure there are tools for that, but I don't have them.