The contract is fine but a worker can cancel the opt out if they wished (in writing, giving I think 7 days notice) and (in theory at least) they can't be discriminated against for doing so.
Worth noting too that the average of 48 hours a week is calculated over 17 weeks so under even under a WTD compliant agreement you could have someone work a month of 60 hour weeks so long as you reverted to 40 hour weeks for a while after to bring the average back down.
The problem here is that any piece of legislation in this category with a "in theory at least" clause against discrimination will become meaningless. This type of legislation must be mandatory, or at the very least subjected to individual exemptions based on centrally negotiated agreements.
That would probably fall foul of the regulations.