If you’re getting a cyclic table reference from something["thing"] = newthing it’s likely because newthing already seems to reference something directly or indirectly creating a loop
In your current example, newthing is not referencing something so something["thing"] = newthing should work perfectly and replace the inner table