I think you’re applying it wrong.
Off the top of my head it should be
dom_node = anvil.js.get_dom_node(self.button_1)
btn_node = dom_node.querySelector('button')
btn_node.tabIndex = '-1'
the anvil button element has an outer html div but the tabIndex needs to be set on the html button element.