This happens because the ttkbootstrap Style singleton isn't reset when the window is destroyed, and tries to use the same window that was already destroyed.
You can fix this by setting ttkbootstrap.Style.instance = None
before recreating the new window.