Problem found. One of the frames, namely "M13_Light_120sec_frame1_2020-07-08_c_d.xisf", is wrongly tracked and has a huge amount of hot pixels represented as groups of several contiguous pixels (forming cross or square artifacts) after demosaicing interpolation. Bad tracking has generated multiple star images. So the problem is:
- The star detection algorithm cannot find reliable stars for alignment, since basically all stars are represented as elongated and defocused artifacts.
- Hot pixel artifacts are too large to be removed by the hot pixel removal routine, so all of them are detected as 'excellent' alignment references.
- Since the amount of false alignment references is so large (about 40,000 detected), the probability of finding a false but mathematically valid registration transformation is very high.
So this is not at all a bug in StarAlignment, which is actually finding a registration transformation very efficiently. This problem is the result of bad data. Remove the above referred frame from the data set and there will be no alignment problems. Also try to calibrate the data correctly, so hot pixels are removed before demosaicing.