### Apache Airflow version

2.6.2

### What happened

All tasks were run 1 time. The try number is 2 for all tasks

### What you think should happen instead

Try number should be 1 if only tried 1 time

### How to reproduce

Run a task and use the UI to look up try number

### Operating System

centos

### Versions of Apache Airflow Providers

_No response_

### Deployment

Virtualenv installation

### Deployment details

_No response_

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes I am willing to submit a PR!

### Code of Conduct

- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)

form_fields[k]["schema"]["type"] = "boolean"
                elif isinstance(form_fields[k]["value"], int):
                    form_fields[k]["schema"]["type"] = ["integer", "null"]
                elif isinstance(form_fields[k]["value"], list):
                    form_fields[k]["schema"]["type"] = ["array", "null"]
                elif isinstance(form_fields[k]["value"], dict):
                    form_fields[k]["schema"]["type"] = ["object", "null"]
            
            if (
                "description_html" in form_fields[k]["schema"]
                and form_fields[k]["schema"]["description_html"]
            ):
                form_fields[k]["description"] = Markup(form_fields[k]["schema"]["description_html"])
            if "custom_html_form" in form_fields[k]["schema"]:
                form_fields[k]["schema"]["custom_html_form"] = Markup(
                    form_fields[k]["schema"]["custom_html_form"]
                )
        ui_fields_defined = any("const" not in f["schema"] for f in form_fields.values())
        if not dag_orm:
            flash(f"Cannot find dag {dag_id}")
            return redirect(origin)
        if dag_orm.has_import_errors:
            flash(f"Cannot create dagruns because the dag {dag_id} has import errors", "error")
            return redirect(origin)
        recent_runs = (
            session.query(
                DagRun.conf, func.max(DagRun.run_id).label("run_id"), func.max(DagRun.execution_date)
            )
            .filter(
                DagRun.dag_id == dag_id,