Good point, and that was for me the promise of the original MOOCs 15 years ago - for students to be able to take on these MIT/Stanford courses, with the exact same workload and see if they could handle them, without any additional cost to the school and without the student having to upend their life yet. And if they proved to themselves that they could and are willing to, then enroll, and use that as proof.
There are still some online courses that try to do this sort of thing, with a particular example being the University of Helsinky's Full Stack Open [0] which offers post-hoc university credits for those who complete the course, but it seems that the dream didn't quite materialize.
[0] https://fullstackopen.com/en/about