'bug in loading scenes with different background

I am trying to add a pause menu in my game SpaceInvaders with the last frame of the game in the background but when I load the pause scene my game does not show the game in the background

the background game looks like this

the first time I load pause it shows this

and then whenever i load pause it behaves normally like this

my game has 3 files :

1)game file

2)pause file

3)init file (that connects above two)


Game file

import pygame
from __init__ import __INIT__

pygame.display.set_caption("Endless")
pygame.init()
screen=pygame.display.set_mode((1920/2,1080/2),pygame.RESIZABLE)

def menu():
    running=True

    while running:
        screen.blit(pygame.image.load("docs/bg.png"),(0,0))
        
        for event in pygame.event.get():
        
            if event.type==pygame.QUIT:
                running=False
                pygame.quit()
                quit()

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_ESCAPE:
                    __INIT__("pause")

        pygame.display.update()
menu()

Pause file

import pygame
from __init__ import __INIT__

pygame.display.set_caption("Pause")
pygame.init()
screen=pygame.display.set_mode((1920/2,1080/2),pygame.RESIZABLE) 

def PAUSE():
    running=True

    while running:
        for event in pygame.event.get():
        
            if event.type==pygame.QUIT:
                running=False
                pygame.quit()
                quit()

            if event.type == pygame.KEYDOWN:
                if event.key == pygame.K_ESCAPE:
                    __INIT__("menu")
                if event.key == pygame.K_h:
                    from __init__ import hello
                    hello()

        screen.blit(pygame.image.load("docs/D_effect.png"),(0,0))
        pygame.display.update()
PAUSE()

init file

def __INIT__(a):
    if a=="pause":
        from pause import PAUSE
        PAUSE()
    if a=="menu":
        from endless import menu
        menu()

I don't know what is causing this issue because it only does it one time I am a beginner it might be a silly mistake I am sorry if that happens

in any case, if u find it difficult to understand my problem please run the endless file in Space_invaders/Space_invaders/endless.py provided here https://drive.google.com/file/d/1FUhGNdXp4CgYcr9PAfey-6ElZhVYMKem/view?usp=sharing



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source