Sometimes, when rendering through Media Encoder, the rendering fails on a memory intensive frame. Usually switching your After Effects project's render engine to "Mercury Software Only", saving the project and then adding it to render queue solves the issue. It seems that Media Encoder is trying to render your video with graphic card, which does not have enough memory for a particular frame to render. Media Encoder uses your project's render engine setting, not the one displayed below the queue.. yes, not very intuitive.
Here is how to do this: