Actually, I have just realized, that even the formula in the cell being moved behaves differently when the cell is moved and when it is copied. In case of copy (as your program also shows), the references (unless $ made) in the formula move relative with the copied cell. In case of move, the formula remains the same.

P.S. This is all about plain move. When something is sorted, even Calc/Excel behave "strange". When a cell is moved as a result of the sort, it is not a real move (i.e. formulas point to the same physical cell as before), but more a copy (formulas move relative calculated from the new position of a moved cell). This is not only giving incorrect results, but can also give formula error (e.g. if B3 has a formula = B1 and when sorting by column A, row 3 gets to be row 1, and then the formula would turn into B-1, what does not exist.

On forums they recommend to use $ formulas, but then again, the literal of the formula remains (as in a move of the cell containing the formula) but not taking into account that the formula it points to also moves.

The solution would be to do the sort as many little moves, when both the moving cell would keep its formula and also when the target cell of the formula moves, then the formula is also updated.

I guess it is the same in FPSpreadsheet (I need to test).