Update your Werkzeug version to the latest available (at the time of writing 3.1.3 solve the issue).
When running Flask locally through app.run(debug=True), I had a very strange issue of random reload of the local dev server
when doing any request raising ConnectionError since the connection was aborted while restarting the server. The reload
kept happening at every request because of source file change even through my editor was closed.
Investigating the issue briefly, it seems that it was caused by a bug in Werkzeug, updating it resolved the issue.