Question: why mixed dml error in salesforce?
Answer: The Mixed DML error is generated – when a User performs DML actions on Setup and non-Setup Objects in the same transaction -because some sObjects affect the user's access to records in the org. ... The time-dependent/scheduled action is used because it helps in separating DML operations on Setup and non-Setup objects.