Hey Peeves,
Trying to understand exactly your requirements just to make sure we are on the same page. I’ve setup the following database structure in Baserow as an example:
A students table which manually links to classes and also has a lookup of a department lookup field in the classes table:
A Classes table which manually links to Teachers and has a lookup through Teachers to department:
A Teachers Table which has a manual link to Departments:
And Finally a Departments Table:
And heres a Diagram showing the links between the tables in the above structure, is this what you were describing?

Students uses Lookup to fill the Link from Classes to Teachers
I’m not exactly sure what you mean when you say use a Lookup to fill a Link. Especially a Link between two other tables. Could you explain how it would look given the above table structure?
Are you perhaps asking for something like VLOOKUP in Excel / google sheets? So instead of me making a manual link between teachers and departments, instead the classes table could say use a VLOOKUP field which links a class row to any department row with the same name? Or am going off on a wild tangent here :D?
I guess fundamentally I don’t understand how could the database know which teacher teaches which class if there was only one manual link between student and class? So I can create a link saying Student A takes Maths class, but if I don’t also create a link from Class to Teacher manually how could the database know that on its own?