Legal or not Legal?

If you do a split shift then you should have a total of 12 hours daily rest in any 24 hours, the 12 hour rest period can be taken in two periods, the first period must be at least 3 hours, and the second at least 9 hours, therefore the maximum work time allowed is 12 hours in a 24 hour period, less any required breaks.

As your split daily rest was only 9 hours in total it was 3 hours short of the required 12 hours so it was not legal.