The BART Schedule uses a special "BART Time" clock which runs from midnight until 2:26am the following day. This is to account for trains that run after midnight. Since this clock is > 24 hours, it has an impact on the schedule results.
QuickPlanner schedules do not run across "BART Time" days. If you schedule a trip at the beginning or end of the schedule, you either get trips from the night before, or trips from the next day. During the time between 2am and 4am, there is a cutoff, called BART midnight, where it switches from one day to the next. The exact time for BART Midnight is currently 2:27 am. Any time before that will return results from the prior day's schedule, and any time after BART midnight will return results for the specified date.
For each QuickPlanner trip requested, the results may include trips before the time requested and trips after the time requested. When calling the depart/arrive schedule commands, you can specify how many trips before/after you want. If none are specified, then the QuickPlanner will default to the same logic used on the website.
If for some reason the trip planner cannot give you the type of trips you requested (before or after), it will still give you the total number of trips requested (before + after), so if you request x before trips and y after trips from or or after BART midnight until the start of the next day's schedule, you'll actually get x + y after trips. Likewise, if you request x before trips and y after trips from the end of the schedule until before BART midnight, you'll get x + y before trips.
Since trains don't run between about 2am and 4am, scheduling a trip during those hours is kind of a weird grey area. The current definition of BART midnight (2:27 am) helps determine what happens during the period when no actual trains are running.
BART API Schedule results do not currently provide a date as part of the "origTimeMin" or "destTimeMin" fields. Any time after midnight but before BART midnight would actually be on the previous day from the <schedule> <date> field as reported in the API results.