This is a known issue, see Overpass API performance issues. Thank AI for abusing donation-funded services.
Solutions:
- Set up your own instance or pay someone to do it for you. Note: Overpass is a dead-end. For production, you will want to use something different, e.g. PostgreSQL.
- Install PostgreSQL, import data with Osm2pgsql and use SQL for querying.
- Use Postpass if you just want to run a single or a few queries.