Just scheduling rolling stock can be complicated in itself:
Stabling has to be carefully planned. For example if you have an 8 coach siding you can't park a 12 coach in it.
Some units will need to go back to depot, as opposed to just a stabling point. For example they may develop a fault during the day or may require routine servicing. Much like a car you have time and/or mileage related service items. There will be a point at which you can't run in service if you exceed that. So you don't want a unit that's nearly out of miles to end the day at Littlehampton rather than Selhurst it that means you can't use it in the morning. You also want to schedule in routine tasks like train wash as well as toilet emptying.
To enable all this crews are allocated a particular unit at start of service, it's not a case of just take anything that's in the car park! If you've got a depot where trains are 'blocked in' then you need to make sure they're assigned to leave in the correct order in the morning.
You also need to match up train length with infrastructure. No good running 12 coaches if you've only got 8 coach platforms. Similar with splitting and joining, you can't join 2 x 8 coach trains.
After you've done all that it needs to match with the crew diagrams so you haven't scheduled anyone to take a train they're not qualified to operate.
Sometimes I think it's a miracle anything manages to run at all as so many parts of three puzzle have to come together!