### Godot version

4.1.3

### System information

Windows 10

### Issue description

E 0:00:47:0705   Message.gd:46 @ from_raw(): Class 'FileAccess' or its base class cannot be instantiated.
  <Erreur C++>   Condition "!ti->creation_func" is true. Returning: nullptr
  <Source C++>   core/object/class_db.cpp:341 @ instantiate()
  <Pile des appels>Message.gd:46 @ from_raw()
                 WebRTCClient.gd:30 @ _process()

`from_raw() is a byte_to_var_with_objects() function`

### Steps to reproduce

try to decode an array containing a FileAccess object among many other vars

byte_to_var_with_objects([FileAccess.open(path, FileAccess.READ), a, b, c, d, ...])

### Minimal reproduction project

N/A
ObjectID val = ObjectID(decode_uint64(buf));
				if (r_len) {
					(*r_len) += 8;
				}
				if (val.is_null()) {
					r_variant = (Object *)nullptr;
				} else {
					Ref<EncodedObjectAsID> obj_as_id;
					obj_as_id.instantiate();
					obj_as_id->set_object_id(val);
					r_variant = obj_as_id;
				}
			} else {
				ERR_FAIL_COND_V(!p_allow_objects, ERR_UNAUTHORIZED);
				String str;
				Error err = _decode_string(buf, len, r_len, str);
				if (err) {
					return err;
				}
				if (str.is_empty()) {
					r_variant = (Object *)nullptr;
				} else {
					Object *obj = ClassDB::instantiate(str);
					ERR_FAIL_NULL_V(obj, ERR_UNAVAILABLE);
					ERR_FAIL_COND_V(len < 4, ERR_INVALID_DATA);
					int32_t count = decode_uint32(buf);
					buf += 4;
					len -= 4;
					if (r_len) {
						(*r_len) += 4;