As long as the intention is right then it is not bad Kamma. If we make a mistake in our action, that is simply a mistake due to lack of enough wisdom. But if our intention was to help, then we are going to have the Kammic result of the intention.
Here's a clear example: You see that there is an ant drowning in the toilet bowl, you go to help it. If you haven't even done it before, if you put your finger there to get it to run onto the finger, your finger often creates a wave and the ant goes away from it. Because of the nature of water, it is hard to do it this way. A trick we have learnt over the years is to always keep an empty toilet roll. When it slides into the water it draws the water in and draws the ant close to it. You might try it if you have never done it. At any rate let's assume that we are trying to get the ant out. Our intention is to save the ant, but in getting it out we accidentally squish it and kill it. This would be an example of when the intention is good and that is our Kamma. The accident occurred, we accidentally killed it, but that was not our intention and therefore that was not the Kamma coming.