581. Performing the Wrong Labor
Shabbos 1:8
If a person intended to perform one type of prohibited labor but accidentally ended up performing an altogether different type of labor, he is not liable because his intention was not fulfilled. For example, if one threw a rock or shot an arrow at a person or an animal, intending to kill them but instead he uprooted a tree, he is not liable. This is all the more so if one intended to perform a lesser action and accidentally performed a more serious one. For example, if one intended to throw a stone into a carmelis (one of the four Shabbos domains) but it went into the public domain instead, he is not liable. The same is true in all similar cases. If one intends to perform a permitted act and ends up performing a prohibited act, he is not liable. For example, if one intended to cut fruit that was not attached to the ground but he ended up cutting fruit that was attached to the ground, he is not liable. The same is true in all similar cases.
Shabbos 1:9
If a person intended to pick black figs but he ended up picking white figs instead, or if he intended to pick figs first, followed by grapes but he ended up picking grapes first, followed by figs, he is not liable. He picked everything that he intended but since he did not pick them in the order that he had planned, he is not liable since his intention was not fulfilled. It is labor that one intends that the Torah specifically prohibits.