Steps to reproduce (tested with version 22.214.171.124.0 on Gentoo linux, I wanted to test on latest but that will have to wait until I update libreoffice):
0. Create an empty spreadsheet in LibreOffice calc
1. Create 2 sheets named Sheet1 and Sheet2 in this spreadsheet
2. In Sheet1, set some value at cell A1
3. In Sheet2, write the formula =$Sheet1.A1 in any cell
4. Select cells A1-A2 (or any range of cells containing A1)
5. Drag and drop that selected cells to move them somewhere else. Reference in Sheet2 changes to new location of the content of A1
6. Undo (ctrl+c or edit->undo). Cell in Sheet1 is moved back to A1. Reference in Sheet2 is not changed back to the original.
This may "corrupt" a spreadsheet beyond practical recovery if noticed too late.
Repro with Version: 126.96.36.199.alpha0+ (x64)
Build ID: b29fb89d0a49fde0f5757774d64a7aba8298ac75
CPU threads: 12; OS: Windows 10.0 Build 18363; UI render: Skia/Raster; VCL: win;
Locale: ru-RU (ru_RU); UI-Language: en-US
No repro with Version: 188.8.131.52
Build ID: 1ba9640ddd424f1f535c75bf2b86703770b8cf6f
Regression after https://git.libreoffice.org/core/+/9079da7f62febaf4cef0b77320c31b4e8bb6b5a5