On the whole, I do not think that a closer should be limited to just pitching the 9th inning. Sometimes, the game needs to be saved in the 7th or 8th innings, and I think it's a mistake to keep the closer on the bench for a save situation that may never come.
That said, I do agree with you that many, probably most relievers are creatures of routine, and they prefer to know exactly what their roles are. Kimbrel certainly comes to mind here. It's on the manager to know his players well enough to discern who can handle what.
For the most part, I think Barnes' 'failure', if you can call it that, came not from the lack of a defined role, but from overuse and overexposure. Cora had to go to Barnes a lot more than he anticipated. Lack of bullpen depth contributed to this, along with the things mentioned in my previous post.