This might have to do with what’s generating the button. I think if you just do cur_frm.refresh you will be refreshing the form, but not the whole page so it won’t get rid of the button. You can also try frm.refresh. Hope that helps!
You have to regenerate the buttons on each refresh. This is because those buttons depend on the state of the form and instead of regenerating them on every trigger, they are regenerated on refresh.