Normally, you’d right click the class in the Content Browser and:
But re-parenting also works (most of the time).
But the issue in your script is with this node:
It does not do what you think it does. It works with this component:
Not with class inheritance.