Shabbat 137 - Transgressing while attempting a mitzvah
Circumcision can be done on Shabbat, but only in it proper time, on the eighth day of the baby's life. If one had two infants to circumcise, one on Shabbat and one on Sunday, but he made a mistake and circumcised the Sunday one on Shabbat - then, since he did not accomplish a mitzvah, he needs to bring a sacrifice.
If two infants were to be circumcised, one on Friday and another one on Shabbat, and by mistake he circumcised the Friday one, on Shabbat, then Rabbi Eliezer still holds him liable, but Rabbi Yehoshua says that he is not: since he tried to perform a mitzvah and ended up actually accomplishing it, albeit circumcising a day late, he should not be punished for his attempt.
An infant may be circumcised, depending upon the calendar, on the eighth through twelfth day. The last case occurs when he was born at dusk on Friday evening and, since it is not known whether dusk is part of the day before or the day after, circumcising him on the next Friday may be too early, but on Shabbat it is not allowed because it may be too late. If in addition the next two days are Rosh Hashana, then he will be circumcised after all holidays, on the twelfth day. Of course, if the child is sick, circumcision is postponed until he becomes healthy.
Art: Joseph Rodefer DeCamp - An Infant