Input.warp_mouse doesn't work as intended after resizing game window

You are mixing different coordinate systems.

  • get_global_mouse_position() returns Canvas Coordinates.
  • Input.warp_mouse(curPos) accepts Screen Coordinates.

You will need to transform the coordinates from one system into the other.
See How to transform screen position to global through a Camera2D? - #2 by Sauermann and How to transform screen position to global through a Camera2D? - #3 by justinjia for documentation links that explain coordinate transforms and the Godot 2D coordinate systems.