Visual scripts should be attached to the parent, root object. In fact, unless there is a specific reason, I believe the understanding is that visual scripts should not be attached to anything other than game objects.
Please re-read the section on the following page: “Finally, register the game object so it can be used with Visual Script. Select the Game Object node sample_2DSprite.”