Is there a way to change how a form button looks?
There are two basic ways in Drupal to remove the class, a PHP hook or a Twig template. It's only possible to describe this in a general way because the question doesn't contain details about which theme and templates are in use.
For a PHP solution find out which hook is adding this class and then implement the same hook in your custom theme. If the attributes contain the specific class you've added to the form build, then remove the conflicting class.
For a Twig solution enable Twig debug, find out which template is rendering the button now, and copy it to your theme's templates folder. Then do the same thing as described before in Twig:
{% if attributes.hasClass('btn-outline-primary') %}
  &lt;input{{ attributes.removeClass('btn-primary') }} /&gt;{{ children }}
{% else %}
  &lt;input{{ attributes }} /&gt;{{ children }}
{% endif %}