Login window not qorking as intended?

On my login window, besides two fields where the user writes their username and password, the user also have two available options. Registerr and recover password. When the user selects either of these two, a new window (registration window and assword recovery window respectively) pops up. However, for some reason, entire login window closes while the other windows never appear once the user selects either of those two options again. What happened? I think it has something to do with def create_one() and def forgot_password(). Here’s the code of the login page window that I have currently:

from tkinter import *
from PIL import Image, ImageTk
from tkinter import messagebox
import pymysql
import psutil
from datetime import datetime
from Mainwin import start_mainwin
import sys

windows=Tk()

windows.title('AquaSense Login')
windows.geometry('490x240+500+100')
# windows.resizable(0,0)
    
#forgot password
def forgot_password():
    windows.withdraw()
    import forgotpassword

#Button Definition process
def create_one():
    windows.destroy()
    import Registration2

def login():
    python_executable = sys.executable
    if idEntry.get() == '' or passwdEntry.get() == '':
        messagebox.showerror('Alert', 'Please enter all entry fields!')
    else:
        db = pymysql.connect(host='127.0.0.1', user='root', password='passworld', database='test')
        cur = db.cursor()
        
        queryActi = 'use test'
        cur.execute(queryActi)
        queryActi='create table if not exists Actividad (actId int auto_increment primary key not null, userId int,FOREIGN KEY (userId) REFERENCES personaldata(id),fecha DATETIME) ' \

        cur.execute(queryActi)

        query = 'select * FROM personaldata where passwrd=%s AND username=%s'
        cur.execute(query, (passwdEntry.get(),idEntry.get(),))
        roles = cur.fetchone()

        if roles == None:
            messagebox.showerror('Alert!', 'Incorrect username or password')
            return


        else:
            login_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S')
            user_id = roles[0]
            insert_query = 'insert into Actividad (userId, fecha) VALUES ( %s, %s)'
            cur.execute(insert_query, (user_id, login_time))
            db.commit()
            messagebox.showinfo('success', 'Login Successful')
            idEntry.delete(0, END)
            passwdEntry.delete(0, END)
            windows.destroy()
            start_mainwin()
            

#username
def on_entry(e):
    idEntry.delete(0, END)

def on_password(e):
    name=idEntry.get()
    if name == '':
        idEntry.insert(0,'username')

#password
def on_enter(e):
    passwdEntry.delete(0, END)

def on_Leave(e):
    password = passwdEntry.get()
    if password == '':
        passwdEntry.insert(0, 'password')


#for hiding data on the entry fields by clicking on the check box
def show():
    passwdEntry.configure(show='*')
    check.configure(command=hide, text='')

def hide():
    passwdEntry.configure(show='')
    check.configure(command=show, text='')



frame=Frame(windows, width=700, height=400, bg='#333333')
frame.place(x=0,y=0)


LogoImage=PhotoImage(file= r'C:\Users\UserPC\Downloads\Personal_Registration_Form-main\Personal_Registration_Form\user (1).png')
idlabel=Label(frame, text='Nombre', fg='orange', image=LogoImage, compound=LEFT, bg='#333333', font=('Calibre', 14, 'bold'))
idlabel.grid(row=1, column=0, pady=20, padx=1)



passwordImage=PhotoImage(file= r'App/image/padlock.png')
passwdlabel=Label(frame, image=passwordImage, compound=LEFT,fg='orange', bg='#333333', text=' Contraseña', font=('Calibre', 14, 'bold'))
passwdlabel.grid(row=3, column=0, pady=10, padx=3)
passwdlabel.place(x=10, y=70)


idEntry=Entry(frame, width=39, bd=3)
idEntry.grid(row=1,column=2,columnspan=2, padx=57)

passwdEntry=Entry(frame, width=39, bd=3)
passwdEntry.grid(row=3, column=2, columnspan=2)

idEntry.insert(0, "username")
idEntry.bind('<FocusIn>', on_entry)
idEntry.bind('<FocusOut>', on_password)

passwdEntry.insert(0, "password")
passwdEntry.bind('<FocusIn>', on_enter)
passwdEntry.bind('<FocusOut>', on_Leave)

loginbtn=Button(frame, text='LOGIN', bg='#7f7fff', pady=10, width=23,fg='white', font=('open sans', 9, 'bold'), cursor='hand2', border=0, borderwidth=5, command=login)
loginbtn.grid(row=9,  columnspan=5, pady=30)


donthaveacctLabel=Label(frame, text='¿No tienes una cuenta?', fg='orange', bg='#333333', pady=4, font=('Calibre', 9, 'bold'))
donthaveacctLabel.place(y=150)

createnewacct = Button(frame, width=15, text='Registrate', border=0, bg='#7f7fff', cursor='hand2', fg='white', font=('Calibre', 8, 'bold'), command=create_one)
createnewacct.place(x=10, y=179)

forgtpw=Button(frame, text='¿Olvidaste la contraseña?', fg='orange',border=0, cursor='hand2', bg='#333333', font=('Calibre', 9, 'bold'), command=forgot_password)
forgtpw.place(x=310,y=102)

check = Checkbutton(frame, text='',
        command=show, bg='#333333')
check.place(x=440, y=83)

ico = Image.open(r'C:\Users\UserPC\Downloads\Personal_Registration_Form-main\Personal_Registration_Form\icon (1).png')
photo = ImageTk.PhotoImage(ico)
windows.wm_iconphoto(False, photo)

windows.resizable(False,False)
windows.mainloop()

Hello,

from this:

in two functions, you have the following function call:

windows.destroy()

Can you, for the moment, comment these two lines out to observe the results.