A 22:00 start and 06:00 end is not a negative duration. With an explicit next-day rule, it is an eight-hour gross shift.
Split the shift at midnight
From 22:00 to 24:00 is two hours, and from 00:00 to 06:00 is six. Together they make 480 gross minutes. Adding 24 hours to the next-day end is the equivalent single formula.
Make next day an explicit choice
An end earlier than the start might mean overnight, or it might be a typing error. WorkHours never guesses: the next-day checkbox distinguishes the two cases and the API validates that choice.
Keep arithmetic separate from workplace rules
After subtracting an entered break, the tool reports worked minutes. It does not label them overtime, apply a night premium, round punches, or decide what labor law requires. Confirm those policies with the appropriate source.