Before making any posts, please check the forum for similar topics. Many references can be found in the forum related to your topic, so be sure to search.
Search: Search results for 'frm.remove_custom_button order:latest' - Frappe Forum
And even if you search in Google, you will find its reference.
Please increase setTimeout 10 → 200.
reload and check.