Convert inner class to json problem

Godot Version

4.5.1.stable

Question

why class_name can converted to json but inner class cannot?

E 0:00:06:923   node.gd:5 @ _ready(): Failed to encode a path to a custom script.
  <C++ Error>   Condition "path.is_empty() || !path.begins_with("res://")" is true. Returning: Variant()
  <C++ Source>  core/io/json.cpp:808 @ _from_native()
  <Stack Trace> node.gd:5 @ _ready()
extends Node

func _ready():
	var u = User.new()
	print(JSON.from_native(u, true))

class User extends Node:
	
	var a = 10