When trading an under construction mega structure, the stellar architect is still owned by the previous owner. If you were to do this by trading your own mega structure away, you can immediately then decommission the stellar architect thereby removing the under construction mega structure, too, which was supposedly traded away.
Version 3.0, build id 18985056

Save game
https://www.dropbox.com/scl/fi/8g8amuzr6qc4ee59lusad/Bug-const-megastructures-ownership.GC4Sav?rlkey=pc7mruhzn8rfvj4jsy44v3p89&st=q5q1u2rx&dl=0