### Godot version

4.0.dev.935a6ef46b7c6af4239b6adce41b8198f051b57a

### System information

macOS 13.1

### Issue description

EDIT: Will be fixed by https://github.com/godotengine/godot/pull/72440

The GLTF importer crashes the engine when importing models from a file at runtime.

I have not traced the issue fully yet, but it was introduced sometime in the last 5 days, between d1e5903c67956707948b1de370b807e3aad395b7 and 935a6ef46b7c6af4239b6adce41b8198f051b57a

```
  ================================================================
  handle_crash: Program crashed with signal 11
  Engine version: Godot Engine v4.0.beta.mirror (024c2181d5173f5b4ebf202dd3252b488ec34bc4)
  Dumping the backtrace. Please include this when reporting the bug to the project developer.
  [1] 1   libsystem_platform.dylib            0x00000001854632a4 _sigtramp + 56
  [2] GLTFDocument::_parse_images(Ref<GLTFState>, String const&) (in godot.macos.editor.arm64) + 9080
  [3] GLTFDocument::_parse_gltf_state(Ref<GLTFState>, String const&) (in godot.macos.editor.arm64) + 684
  [4] GLTFDocument::_parse(Ref<GLTFState>, String, Ref<FileAccess>) (in godot.macos.editor.arm64) + 1976
  [5] GLTFDocument::append_from_file(String, Ref<GLTFState>, unsigned int, String) (in godot.macos.editor.arm64) + 780
```

Full stack trace:

<details>

```
  ================================================================
  handle_crash: Program crashed with signal 11
  Engine version: Godot Engine v4.0.beta.mirror (024c2181d5173f5b4ebf202dd3252b488ec34bc4)
  Dumping the backtrace. Please include this when reporting the bug to the project developer.
  [1] 1   libsystem_platform.dylib            0x00000001854632a4 _sigtramp + 56
  [2] GLTFDocument::_parse_images(Ref<GLTFState>, String const&) (in godot.macos.editor.arm64) + 9080
  [3] GLTFDocument::_parse_gltf_state(Ref<GLTFState>, String const&) (in godot.macos.editor.arm64) + 684
  [4] GLTFDocument::_parse(Ref<GLTFState>, String, Ref<FileAccess>) (in godot.macos.editor.arm64) + 1976
  [5] GLTFDocument::append_from_file(String, Ref<GLTFState>, unsigned int, String) (in godot.macos.editor.arm64) + 780
  [6] GLTFDocument::_parse_gltf_extensions(Ref<GLTFState>)
  [7] GLTFDocument::_parse_gltf_extensions(Ref<GLTFState>)
  [8] GLTFDocument::_parse_gltf_extensions(Ref<GLTFState>)
  [9] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (in godot.macos.editor.arm64) + 73812
  [10] Variant::callp(StringName const&, Variant const**, int, Variant&, Callable::CallError&) (in godot.macos.editor.arm64) + 228
  [11] GDScriptFunction::call(GDScriptInstance*, Variant const**, int, Callable::CallError&, GDScriptFunction::CallState*) (in godot.macos.editor.arm64) + 63144
  [12] GDScriptInstance::callp(StringName const&, Variant const**, int, Callable::CallError&) (in godot.macos.editor.arm64) + 348
  [13] Object::callp(StringName const&, Variant const**, int, Callable::CallError&) (in godot.macos.editor.arm64) + 188
  [14] Callable::callp(Variant const**, int, Variant&, Callable::CallError&) const (in godot.macos.editor.arm64) + 176
  [15] CallableCustomBind::call(Variant const**, int, Variant&, Callable::CallError&) const (in godot.macos.editor.arm64) + 452
  [16] core_bind::Thread::_start_func(void*) (in godot.macos.editor.arm64) + 552
  [17] Thread::callback(Thread*, Thread::Settings const&, void (*)(void*), void*) (in godot.macos.editor.arm64) + 176
  [18] Thread::~Thread()
  [19] 19  libsystem_pthread.dylib             0x000000018543506c _pthread_start + 148
```

</details>

### Steps to reproduce

Occurs when importing GLTF models at runtime. The same models import correctly when placed in the `res://` folder and imported by the editor. I will try to isolate this to a single model (or maybe it occurs on all? dunno yet).

### Minimal reproduction project

It occurs on my company's project, I will try to reproduce it in a smaller project, but wanted to open this issue ASAP in case someone already has an idea of what would be causing this.
String text;
	text.parse_utf8((const char *)json_data.ptr(), json_data.size());
	JSON json;
	Error err = json.parse(text);
	if (err != OK) {
		_err_print_error("", "", json.get_error_line(), json.get_error_message().utf8().get_data(), false, ERR_HANDLER_SCRIPT);
		return err;
	}
	p_state->json = json.get_data();
	
	chunk_length = p_file->get_32();
	chunk_type = p_file->get_32();
	if (p_file->eof_reached()) {
		return OK; 
	}
	ERR_FAIL_COND_V(chunk_type != 0x004E4942, ERR_PARSE_ERROR); 
	p_state->glb_data.resize(chunk_length);
	len = p_file->get_buffer(p_state->glb_data.ptrw(), chunk_length);
	ERR_FAIL_COND_V(len != chunk_length, ERR_FILE_CORRUPT);
	return OK;
}
static Array _vec3_to_arr(const Vector3 &p_vec3) {
	Array array;
	array.resize(3);
	array[0] = p_vec3.x;
	array[1] = p_vec3.y;
	array[2] = p_vec3.z;
	return array;
}
static Vector3 _arr_to_vec3(const Array &p_array) {