Godot thinks a custom resource is of type string when accessing it by index variable

Yes. The short answer is that GDScript does not offer the type meta support other languages do.

See this post for more details: Inconsistent Invalid index type for dictionary - #10 by gertkeno