If an employee has a leave date but is still being processed through a final payrun and that payrun is open, there should be no facility to send the P45 until the employees final payrun has been processed.
If the P45 is sent before the final payrun has been finalised then the figures on the P45 will be sent incorrectly to employees.
This will be raised as a bug if the system is not currently working as you have suggested