Start here. This is the direct spoken answer to practice first.
Overview
The bug is usually not that JavaScript copied an object incorrectly. It is that two paths still reach the same mutable object.
Objects are values with identity, and variables can refer to the same object. If two UI states share that reference, a mutation through either path is visible through both. I would confirm the shared identity, find where the reference was reused, and replace the mutation with an update that creates the changed object and every changed container along its path.