ResourceLoader progress not finishing at 1

Godot Version

v4.2.2

Question

Tried to make a loading screen that displays loading progress. All of the assets in the scene to be loaded is fully loaded but the loading progress text always end at 43.75% instead of 100%. print(str("Loading… ", progress[0] * 100)) shows that progress only goes up to 43.25 instead of the expected 100. Does anyone have a clue why?

extends Control

const game_scene_path = “res://scenes/gamescene.tscn”

var loading_status : int
var progress : Array[float]

func _ready() → void:

Request to load the target scene:

ResourceLoader.load_threaded_request(game_scene_path)

func _process(_delta: float) → void:

Update the status:

loading_status = ResourceLoader.load_threaded_get_status(game_scene_path, progress)

Check the loading status:

match loading_status:
ResourceLoader.THREAD_LOAD_IN_PROGRESS:
print(str("Loading… ", progress[0] * 100))
if $ProgressBar.position.x <= 315:
$ProgressBar.position.x = 258 + (progress[0] * 100 * 3.25)
$ProgressBarText.text = str("Loading… ", floor(progress[0] * 100), “%”) # Change the ProgressBar value
else:
$ProgressBar.position.x = 315
$ProgressBar.size.x = 80 + (progress[0] * 100 * 3.25 - (57/325))
$ProgressBarText.text = str("Loading… ", floor(progress[0] * 100), “%”) # Change the ProgressBar value
ResourceLoader.THREAD_LOAD_LOADED:
# When done loading, change to the target scene:
await get_tree().create_timer(5).timeout
get_tree().change_scene_to_packed(ResourceLoader.load_threaded_get(game_scene_path))
ResourceLoader.THREAD_LOAD_FAILED:
# Well some error happend:
print(“Error. Could not load Resource”)