Say we baton passed substitute to shedinja.
Substitute does not block recoil from Life Orb, sandstorm damage or attacks such as Flare Blitz anyway and Shedinja is not any exception.
Shedinja would get the standard protection from substitute if it's baton passed to it.
The only thing is that it cannot make a substitute itself.
So secondary moves like stealth rocks, spikes, and sandstorm/hail will still deal damage upon switching but moves like water gun do nothing with the substitute up.