A couple of observations about this data. If you go back to the original FocusMax papers, they found that the slopes of the curve are linear except at the very bottom and that the slopes of each side are not necessarily the same. That would suggest that doing a quadratic fit might not be the best idea because a quadradic curve is not linear on the wings and it is a symmetrical curve. Looking at the samples #1,#6, and #7 it does appear (by eyeball) that if one where to do a better linear fit of the wings, you would also get a better focus result than SGP achieved. I also note that for those three examples, the difference between the S and Q result is not very large (60 steps in one case, 30 for the others). On my setup that difference would be almost identical focus. Thus I don’t find the argument for quadratic fit to be compelling.
It is true that the SGP approach needs some help but I think the effort should be directed toward getting a better linear fit for each side and calculating a “goodness” value to determine if the result is valid. As another poster has suggested, you can calculate the sigma of the HFR values for each exposure and use those values as a weighting factor for a linear fit. Perhaps the sigma value could be used to determine if a particular exposure should be redone.
While using a quadradic fit is tempting, it is not supported by the basic physics of the situation. With the treasure trove of data you are gathering, perhaps you could look for better linear fit algorithms. The SGP approach seems to work well with good data but falls apart with marginal data. Unfortunately, I imagine your data only includes the mean HFR value for each exposure and not the sigma so you won’t be able to test that approach.