Error 400: already has an active run

I solved the problem. What was happening is that I was indeed calling a new run in the same thread. The reason it was happening is that I was doing it normally when the run had failed. It is necessary to cancel the run before opening a new one. More information: How to delete a pending run in Assistants?