My son was applying to geology grad schools a couple of years ago and was missing some of the class prerequisites. He was considering 2 options: first option was to attend an accredited university as a non-degree student after you graduate, and just take the missing classes; second option was to apply and take the missing classes as part of the masters but adding on a semester or two of study, several masters programs he looked at allowed for this.
It was recommended to him that enrolling as a non-degree student at one of the schools he was interested in for his masters would be a great way to check out the programs and faculty, and I’m sure that would be true, but for him the logistics where too tricky. He would have had to move to a new place, find a job and take classes at his own expense. If you you live near a college where you can take non-degree classes while you work after you graduate, then it would be pretty easy to pick the needed prerequisites.
He ended up doing the second option, he found a program he liked that would allow him to take the missing classes as part of his masters, it extended his masters program from 2 to 2 1/2 years and he was not offered a TA position until he finished the prereqs. Each masters program makes it’s own rules, carefully read the requirements for admission.