Why pause button works once?,Pause button works only once

Hey. I made the main menu and the pause menu for the 2D runner. All switching between the scene works fine. But the pause mode works once, when I resume the game and try to pause again, nothing happens. A character can interact with the world, etc. In short, a pause is set once. Maybe someone came across a similar one, it will be cool if you tell me a solution to the problem. Thanks!

using System.Net.Mime;
using System.Linq.Expressions;
using System.Threading;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class PauseMenu : MonoBehaviour
{

    public static bool GameIsPaused = false;
    
    public GameObject pauseMenuUI;
    void Update()
    {
        if (Input.GetKeyDown(KeyCode.Escape))
        {
            if (GameIsPaused)
            {
                Resume();
            }
            else
            {
                Pause();
            }
        }
    }
    public void Resume()
    {
        pauseMenuUI.SetActive(false);
        Time.timeScale = 1f;
        GameIsPaused = true;
    }

    void Pause()
    {
        pauseMenuUI.SetActive(true);
        Time.timeScale = 0f;
        GameIsPaused = true;
    }
    public void LoadMenu()
    {
        Debug.Log("MainMenu");
        Time.timeScale = 1f;
        SceneManager.LoadScene("MENU");
    }

    public void QuitGame()
    {
        Debug.Log("Quit");
        Application.Quit();
    }
}

Under Resume() you need to set GameIsPaused = false