It seems that you're facing a common issue where a local flow run can go into an unresponsive state, making the Prefect UI reflect an inaccurate status. From the documentation excerpts and GitHub issues I examined, there is no direct and straightforward method to manually set a flow run's status to "failed."
However, based on a related
GitHub issue, automations in Prefect 2.x can potentially be configured to cancel flow runs and change their states under certain conditions. This implies that Prefect does have a mechanism for changing flow run states, but the feature you are asking for—to manually mark a flow as failed—is not yet available or it may require interactions with the Prefect API or backend to resolve.
In cases like these, assuming direct manipulation of flow states is not available in the Prefect UI or CLI, a common workaround is to interact with the Prefect server or Prefect Cloud API to manually update the state. Given that there is no accessible snippet for doing this, it might involve using the GraphQL API or Prefect client methods to programmatically set the flow run state to failed.
For now, I would recommend reaching out to Prefect support or posting on the Prefect community Slack or Discourse forums to seek guidance specific to the Prefect version you're using (as handling of flow states may differ between versions). If such situations are frequent, consider raising a feature request in the Prefect GitHub repository to improve handling of scenarios where flow runs get stuck in an incorrect state.