Why DataLoader Results Must Preserve Key Order
A DataLoader batch function must return results corresponding positionally to the requested keys. If the requested keys are [A, B, C], the returned array must represent [resultA, resultB, resultC].
Database queries do not necessarily return records in the same order as the input IDs. Therefore, a reliable implementation should build a lookup map and reconstruct the result array using the original key order.
This is one of the most important implementation details when writing custom DataLoader batch functions.