**Reproduce on main:**
- Run a DAG
- Rename the DAG
- Wait for dag file processor to remove the deleted DAG and add the new one. (Old Dag should not appear on the home page anymore)
- Go to the Browse DAGRUN page.
- Click on a DagRun of the deleted DAG, as if you want to see the 'details/grid' of that old dag run

More info and screenshots here:
https://github.com/notifications#discussioncomment-6898570

![image](https://github.com/apache/airflow/assets/14861206/7af81643-6278-4d90-a20f-6aa7b259ce59)



downstream_tis_to_clear.extend(
                        dag.clear(
                            start_date=dag_run.execution_date,
                            end_date=dag_run.execution_date,
                            task_ids=downstream_task_ids_to_clear,
                            include_subdags=False,
                            include_parentdag=False,
                            session=session,
                            dry_run=True,
                        )
                    )
            
            models.clear_task_instances(tis=tis_to_clear + downstream_tis_to_clear, session=session, dag=dag)
            cleared_tis_count += len(tis_to_clear)
            cleared_downstream_tis_count += len(downstream_tis_to_clear)
        return cleared_tis_count, cleared_downstream_tis_count
    @action(
        "clear",
        lazy_gettext("Clear"),
        lazy_gettext(
            "Are you sure you want to clear the state of the selected task"
            " instance(s) and set their dagruns to the QUEUED state?"
        ),
        single=False,
    )
    @auth.has_access_dag_entities("PUT", DagAccessEntity.TASK_INSTANCE)
    @provide_session
    @action_logging
    def action_clear(self, task_instances, session: Session = NEW_SESSION):