Will Shimano M6000 Rear Derailleur SG (medium cage) work with cassette other then 42t?
The min/max sprocket size spec of 42 does actually make some sense if you think about how the parallelogram of the derailleur works.

On derailleurs designed for large sprocket ranges the cage is moved a long distance vertically as it moves horizontally. At the inner position, the cage is too low and too far away from the axle to work with a small lowest gear sprocket.

That said, you could probably get away with running 2-4 teeth smaller than the specified minimum. If you want to go to a large sprocket of 30 or less teeth, you should be looking at a different derailleur.