pub fn teardown_window_nodes_system(
    mut removed_windows: Extract<RemovedComponents<Window>>,
    mut render_graph: ResMut<RenderGraph>,
) {
    for window_entity in removed_windows.read() {
        if let Err(err) = render_graph.remove_node(EguiPass::from_window_entity(window_entity)) {
            log::error!("Failed to remove a render graph node: {err:?}");
        }
    }
}
Tears render nodes down for deleted window Egui contexts.
src/render_systems.rs