I’m not a TV writer, but I know a lot of them. So you can’t offend me.
You’re describing the old studio system, which fell apart under its own weight. It was just too expensive to keep the writers and actors on the payroll. Also comic books back in the day worked that way. Note: one of the guys who created Superman was living on welfare and blind from diabetes during his last years. The comic book company was shamed into paying him a small stipend after a series of news stories on TV.
The model isn’t the janitor, but the book writer who receives a royalty for each book sold.
By the way, this is how Bill Gates got rich. He turned down IBM’s offer of a relatively large flat fee for DOS and settled for a lesser amount plus royalties for each copy sold and the right to sell DOS to other companies. He treated software as intellectual property and not product.
I don't disagree with you about film writers, they are like book writers. If it does not sell, no compensation. However, a writer that is employed to write gets paid regardless if the shows flops or not. Big difference.