Unity. Inspector references to objects disappear after restarting the scene

The bug occurs in two cases. 1) When I restart the scene. 2) When I go to another scene and then come back. The game works correctly only after the first start of the scene.

The essence of the bug is that there is an error:

MissingReferenceException: The object of type ‘Transform’ has been destroyed but you are still trying to access it.

Although looking at the instpector, you can see that there is a link to the object and clicking on it in the hierarchy opens this object. To get around this problem I used GameObject.Find and it worked, but there are a lot of such links and I need to fix it another way.

The code where the error concerns the ropeParent object:

if (ropeParent.childCount > 0)
{
    Destroy(ropeParent.GetChild(0).gameObject);
}

ropeParent field:

[SerializeField] private Transform ropeParent;

Inspector screenshots:

Is this happening on a DontDestroyOnLoad game object? Any objects referenced by the DDoL game object will be ‘destroyed’ when the scene is unloaded. When you reload the scene, that is a different instance of the scene, and any references to objects in it are not restored.