Here is what is inside the packedscene if I save it as a .tscn file:
[gd_scene load_steps=2 format=2]
[ext_resource path="res://...some long path.../VirFolder.gd" type="Script" id=1]
[node name="hello" type="Node"]
script = ExtResource( 1 )
It seems like the script is properly attached to the node from here, however when I call .instance on the packedscene the newly instantiated node/s have no script attached.
========= EDIT =============
I found out that the problem only happens to scripts that extend other scripts. In a newly instantiated scene, all the nodes whose scripts extend a builtin type have their script attached, those whose scripts extend another script do not have any script attached.