In a middle position, if you make a positional error that will make your endgame chances of winning pretty low, if you make a tactical mistake you may as well say goodbye to the endgame and the game itself.
Opening is important because trust me.. if you start out bad and have a cramped position throughout the whole game, you will probably have no winning chances and very few drawing chances,
i would say endgame is the least to worry about--- but VERY important to study.
Just my 2 cent.
Some people say that memorizing the openings is the most important, others say the endgame, snd very few say the middlegame. I'll get straight to the point, I think it's the endgame because in the opening or middlegame, you make the slightest mistake and you're still in it, but in the endgame that can turn a winning postion into a draw or loss. Plus, memorizing openings doesn't improve your game, but by studying the endgame you experience the real potential of the pieces.