As done in upstream Godot via GH-57205. Add a test that ensures it works also for "gdextended" objects.