Focus problem when removing a row from a table

I have a table and in the last column, I have a set of buttons for some actions. One of them is to delete the row. When clicked, a bootbox appears asking for confirmation and, if so, a submit is made to the form that exists for this purpose. The problem is related to the “focus”, because in one of these operations (bootbox or delete button), the focus is lost as the line is removed and from then on the error occurs:
“Blocked aria-hidden on an element because its descendant retained focus. The focus must not be hidden from assistive technology users. Avoid using aria-hidden on a focused element or its ancestor. Consider using the inert attribute instead, which will also prevent focus. For more details, see the aria-hidden section of the WAI-ARIA specification at Accessible Rich Internet Applications (WAI-ARIA) 1.3.
Element with focus: button
Ancestor with aria-hidden:...”
and I can no longer remove anything until I refresh the page.
The code I have is as follows: