Yes, there are multiple factors that go into that.
When you’re outdoors you should still strive to hit your prescribed intervals without taking any breaks, especially as the intensity increases. That can get challenging with longer SS and Tempo work, but the intervals are the important bit here. Two 10 minute intervals at 90% are not equivalent to one 20 minute interval at the same intensity.
How you rest between intervals is not as critical so long as it’s adequate to nail the remaining intervals. If you have to coast a bit, or take a little longer to line yourself up with a good stretch of road, you’ll still get the intended benefit. Spinning at 40% does add some secondary benefit, but it’s not critical to the success of the workout.
When it comes to a Z2 ride, maybe the best way to think of it is the entire ride is just one long interval. When you interrupt it, you need to add back a bit more time to get the same intended benefit.