The gemara is searching for a case where there can be 2 parteners in a bor. The gemara suggests that if 2 people would together pay a third person to dig a bor, the first 2 would not be considered partners in the bor. The reason is that it is considered an aveira to dig a bor in the reshus harabim, so ein shliach l'dvar aveira would make the digger completely responsible for the bor, and the action would not be attributed to the first 2 at all. The gilyon Hashas refers to 2 sources, one a mishne l'melech, and the other a turei Even.
The Mishneh l'melech proves from this gemara that even by an issur d'rabonon we say ein shliach l'dvar aveira. He assumes that the aveira here is damaging the reshus harabim as rashi writes on 53a, and it is only an issur d'rabonon, yet we say ein shliach l'dvar aveira. I am not sure why he assumes that issur of damaging the reshus harabim is only d'rabonon. Is it only an issur d'rabonon to damage someone else's property? It would seem that it should be considered d'oraysa!
The Tueri Even discusses Tosafos in Kiddushin 42b who assumes that if the shliach is unaware that the act is an aveira then the sender is liable because the argument of דברי הרב ודברי התלמיד דברי מי שומעין no longer applies. The Turei Even proves from our sugya that even when the shliach is a shogeg we still say אין שליח לדבר עבירה. We can always say that the case is where 2 people appoint a third to dig a bor in reshus harabim without him being aware that there is an issur, so if tosafos is correct the first 2 should be liable for the bor. From the fact that the gemara doesn't entertain this case implies that even if the shliach is a shogeg we still say אין שליח לדבר עבירה. Based on this proof, rashi becomes somewhat problematic because rashi explains that the concept of אין שליח לדבר עבירה is entirely based on the concept of דברי הרב ודברי התלמיד דברי מי שומעין which certainly should not apply to a case where the shliach is a shogeg.
Another issue that I have is that if rashi 53a is correct that the aveira we are speaking about is the damage to the reshus harabim, the chiyuv of bor doesn't seem to be connected to the aveira. Normally when we say ein shliach l'dvar aveira, the issue is attributing the aveira such as murder or stealing to the sender rather than the agent. But, in this case the person who is digging the pit is doing 2 seperate activities: 1. he is doing an aveira of ruining the reshus harabim. 2. he is causing a public hazard by putting a bor in the reshus harabim. The 2 are not related because one can technically place a bor in the reshus harabim such as a stone, and not be in violation of an aveira of ruining the reshus harabim, yet be liable for the bor. Therefore, the concept of אין שליח לדבר עבירה should only exempt the sender from the violation of ruining the reshus harabim, but he should still be liable for the damages caused by the bor that he asked the agent to dig. It must be that the aveira at hand is the setting up of a bor, just as any mazik is an issur aside from the liability, so the aveira is completely tied to the person who is liable for the damage. Therefore, if אין שליח לדבר עבירה says that the sender did not do the issur of digging the bor thereby setting up a public hazard, the agent would be the one who set up the danger and therefore the agent would be liable for the damages.