and the physician's guild is making him work for free.
I don't see him working for free. They will pay him for his services. They probably don't want to pay too much to an outsider, but since they only need to do it once, as it's about teaching their own people, it doesn't really matter in the long run.
Seriously, that society feels highly unfuctional.
Nah, it seems about right. The Middle Ages had a strong guild system. Anyone working publicly outside of it, in any profession covered by a guild, would have faced dire consequences. It also wasn't uncommon that every decent person basically needed to belong to something, be it a family with a proper guarantor or a guild, unless they were in the service of the state, local noble, the church, or other such large organisations (being a sailor belonging to a legit crew would also suffice). Depending on the place, like always, simply being a vagrant could have been a crime.