I’d say be careful, especially if you’ve extended the duty day beyond the norm, e.g. by use of captain’s discretion. Certainly if you are driving in the U.K. and looking for a legal precedent you might want to look up the Great Heck (or Selby) rail disaster.
The court decided that the road vehicle driver whose actions led to that accident was driving whilst sleep deprived - he got a 5 years prison sentence.