Did you ask the company that rejected you what the reason was? Did they tell you that it was the programming task or did you just assume it was? It is very likely that you did well, but one of the other candidates was a better fit overall... or had previous fin-tech experience or was slightly more experience... or something similar.
You as a programmer aren't expected to know everything. If you encounter a company which expects you to know everything in a particular narrow area even though they know you have no prior experience in that exact area, you probably don't want to work with them anyway.
Just go to an interview, do your best and don't worry too much about it. You are either a good fit for them or you aren't... and there are either better candidates than you or there aren't. There's not much you can do about those factors.