I assume that you resize and center the window all in the _ready() function.
if that's true, then you're doing it wrong.
WHY:
you resize and center the window at the same time which can cause this task to create a lag.
SOLUTION:
resize the window on the _ready() function and center the
window in the resize listener function as shown below.
EXAMPLE:
func _ready() -> void:
OS.window_size = Vector2(1280, 720) # replacing the numbers with your desired window size
func _on_yourscenename_resized() -> void:
OS.center_window()
if the above code does not work, then you can use the alternative below
EXAMPLE 2:
func _init() -> void:
OS.window_size = Vector2(1280, 720) # replacing the numbers with your desired window size
func _ready() -> void:
OS.center_window()