Like any credit or debit card, HSA/FSAs can be declined if any of the data from the card is incorrect (number, expiration date, zip code etc). Flex will alert you in checkout if any of these fields is missing or incorrect so you can update them.
The most common reason for rejection of the card is insufficient funds. Reach out to your HSA or FSA provider to verify the amount of money in your account before attempting to complete your purchase again.