UPenn is a CSS Profile school and they calculate an EFC based on their own methodology that may or may not be even close to your FAFSA EFC. It is likely that your friend’s family got a lower EFC based on their CSS Profile info.
It’s also possible that they’re not giving you the whole picture and that it’s not truly the total COA that is $27,000. That could be what they’re paying + work study + loans. Penn’s financial aid packages have been known to contain large amounts of work study. Large enough that it’s unrealistic the student can actually earn that amount during the school year.