Not sure, but I think it's the opposite with Aadhar. Firstname is mandatory and Surname is not.
So when the system compares your name in Aadhar and PAN, it reports a mismatch and fails, because the firstname is present in one and absent in the other, and vice versa for the surname.
If only, every document followed a uniform naming scheme!