What do the middle digits of course codes represent? Take the course code PHYS 3054 or PHYS 354. The physics department doesn't offer 54 courses at the 300 or 3000 level.

I imagine some universities subscribe to a set of common best practices for course numbering. So I suspect that there might be an answer that applies to the numbering systems of a number of institutions.
I suspect it really depends on the university. But in my university, it represents the subfield in the department within which the course is offered.

For example (I'm in electrical engineering), EE X1X might be courses on power systems engineering, EE X2X on communication networks, EE X3X on  signal processing, EE X4X on electronics...

But in my department at least, there are enough misnumbered courses (for "historical reasons") to confound anyone who doesn't know it and is looking for a pattern.