Both. Some students take DE on the high school campus and some take them on CC campuses. The courses are supposed to be identical - same syllabus, etc.
My two older kids took theirs on the CC campus. One had his credits transfer and the other didn’t. My youngest went to our public high school rather than homeschooling high school. His courses were at our high school. His courses counted. It all depended upon the colleges they chose.
Some colleges don’t want DE because they feel the credit was a high school credit, not college (can’t count both ways). Others don’t want the DE due to the content. Higher level schools tend to be in the latter category from my experience with my own kids heading to college.
And then there are the schools (many) that will allow CC credit, but not counting toward one’s major field(s) of study.
It really helps students heading the CC route if they do their homework PRIOR to signing up for classes (knowing their goals), not after and then ending up in the OP’s position.
Penn St is a good school. Assuming their transfer app is accepted (the GPA could be a problem), they aren’t “screwed” by not getting into Cornell. Then too, most of us on here realize the chance of getting accepted to Cornell with the reported GPA is pretty slim.