My Add to Cart Button is not working, gets stuck on Adding

The product page form id refers to a string

product-buttons-form-template--21902126481726__main

which can’t be converted to a number.

Whereas on fast add it refers to an input field which holds the numeric value of the variant:

input#formVariantId