If you are going on just observation then it is possible to be wrong. Such the example with all swans being white. However science goes much further than that. It makes observations but then also tests them, and seeks to explain why things happen. Things like gravity should continue and always be true. With our understanding of gravity we can say with certain that if you drop something it will fall to earth, unless there is a force stronger pushing or pulling it upwards.

If something works over and over in the past, then it should work in the future. If it didn't work, then something has changed. There should never be a situation that is repeatable, that always has the same result, and then later in an identical situation doesn't work. If that happens either it isn't an identical situation, or you didn't test it well enough to start with. Obviously if you do something twice, that isn't adequate to judge how something will react in all future situations.