Minor correction for your correction:
"Toe the line" most likely has it's roots in military tradition [1]. To toe the line is to stand at the line for inspection - it's still used that way today (I had to do it myself in boot camp).
Relevant, as in this context, it means being obedient to the hierarchy.
1 - https://en.wikipedia.org/wiki/Toe_the_line#:~:text=The%20mos....