Most philosophers have agreed for centuries that we can be completely sure of very little, if anything. Descartes famously argued cogito ergo sum, i.e., that the action of contemplating the possibility of his nonexistence confirms his existence (a nice early example of a "self-defeating proof by contradiction"). This particular argument is no longer thought to be unassailable: see the linked article.
Thus the idea that you cannot be completely sure that a mathematical proof is correct is true, but in the same way that you cannot be completely sure of virtually anything: i.e., in a not very interesting way and one which has nothing to do with mathematical knowledge in particular.
You seem to be arguing that a special feature of mathematical verifications is that they can be long and complicated. I disagree that this is particular to mathematics. Suppose I wanted to create a list of all days between September 1, 2010 and September 1, 2020 in which the temperature in my condo never exceeds 80 degrees Fahrenheit. What a pain in the butt it would be to be even reasonably certain about this: possibly I would want someone to remain in my condo at all times, probably I would want to buy some scientific equipment (I don't trust my thermostat that much, especially to distinguish between 79.5 and 80 degrees); certainly the task will take ten years to complete. This is a long, difficult, esoteric verification that has nothing to do with mathematics.
As I have tried to point out, nothing that you say argues against "we thought that mathematics is the most secure branch of knowledge". You also don't see who "we" are or why we thought that, but as it happens I do think that mathematics is, relatively speaking, an especially secure branch of knowledge. If I spent ten years thinking about the proof of the Poincare Conjecture, then at the end I would be much more secure in my opinion that it was correct [or, possibly, incorrect!] than I would be at the end of my condo temperature experiment. For PC I would have a coherent, well-understood argument that I could turn around, adapt to other situations, explore consequences of, etc. I could burn all the original documents I read during those 10 years and not be much worse off. For my condo temperature experiment I would just have reams of data and greater or lesser amounts of experimental doubt.
Complicated things are indeed complicated, and I think we must be honest that there is always the possibility (and very often, the reality) of human error. Coming back to Descartes, he believed that he had discovered a method by which it was possible to reason perfectly without error, and he applied his method to develop the new field of analytic geometry. This was fantastic, pioneering work. But entirely without error? Of course not; as is well documented, he made some mistakes. So do almost all of us.
But I would claim that a relatively simple mathematical proof has one of the highest degrees of certainty that we can muster. In another response, someone mentioned the infinitude of prime numbers and indeed there was a previous question on this site with the title "Is it possible that there are only finitely many primes?" When we answer No! we are more sure of this than a researcher in any other field I can think of could be.