Error calling function after loading a custom class from a .res file

Godot Version

4.3

Question

When I am loading a class which is derived from ArrayMesh from a file (.res), I get the following error. It happens on any function from that class when called. Does anyone know how I can get this to work?

Invalid call. Nonexistent function 'test_func' in base 'ArrayMesh (LeafPetalSurface)'.

This is the relevant part of the code; the body of test_func doesn’t matter afaik.
image

Please let me know if more context is needed.
Thank you for your time!

Edit: Just in case it’s relevant, I think it’s saving it correctly since the properties of LeafPetalMesh are showing up in the saved resource when I select it.

Edit2: I am able to access the Outline Spline seen in the above image from the code, which is even stranger to me haha

Update

I know what the root of the problem is now, but I am still wondering why it doesn’t want to play nicely.

I did some testing and it works perfectly in the game when I hit play, but not when running in the editor (it’s a tool script).

The question now is: Does anyone know why this would be?

Okay… so Uhhhh…

It’s because the LeafPetalMesh class wasn’t a tool script. :')

Feeling pretty silly; thanks for your time if you’re reading this!