One of the basic requirements in order for a person to be found liable for violating the Shabbat is that the activity must be a positive action, done with awareness of the transgression. For that reason, someone who is mekalkel – does a destructive act – or is mitasek – does an act without being fully aware of what he has done, will not suffer any punishment.
The Mishna (71b) teaches that someone who slaughters the korban Pesah on Shabbat with the intention that it should be for people who cannot eat it (e.g. for people who are not circumcised or people who did not agree to participate in this specific sacrifice) will need to bring a sin-offering. Since he thought that he was killing the animal for the korban Pesah – a purpose that would be permissible on Shabbat – but it turned out that he was mistaken, he performed a forbidden act for which he is liable, and he therefore has to bring a sin-offering.
Rav Huna bar Hannina raises the obvious question on our daf. What positive outcome did the person who mistakenly slaughters the korban Pesah on Shabbat accomplish? This should be a case of mekalkel – a destructive act – and he should not be obligated to bring the sin-offering!
The Gemara explains that, in such cases, the person who slaughters the animal fulfills a positive act, since the Gemara in Massekhet Zevahim (84a) teaches that in such a case, if the animal is mistakenly brought to the mizbe’ah, it is sacrificed.
Some of the commentaries ask about a case where the animal is slaughtered with the wrong intention – in such a case, what is the positive act that would obligate the person to bring a sin-offering? The Sefat Emet explains that in such a case, the korban Pesah becomes a korban shelamim. Since the korban Pesah must be eaten the same night, while the shelamim can be eaten an extra day, the wrong intention actually assists the person who brings the korban avoid the problem of notar – having forbidden leftovers.