Add Button to Node View
Just tried it out myself and for me it didn't work using your malformatted #attributes array. After I fixed it the following did work. class must provide another array.

/**
 * Implements hook_ENTITY_TYPE_view().
 */
function MYMODULE_node_view(array &amp;$build, \Drupal\Core\Entity\EntityInterface $entity, \Drupal\Core\Entity\Display\EntityViewDisplayInterface $display, $view_mode) {

  $build['mybutton'] = [
    '#type'       =&gt; 'button',
    '#name'       =&gt; 'mybutton_name',
    '#value'      =&gt; t('Click Here'),
    '#attributes' =&gt; ['class' =&gt; ['button', 'button--primary']],
    '#weight'     =&gt; -11,
  ];
}