Late for OP but wanted to share a solution that worked for my situation on this error. I had ~500,000 polygons and merge could only do ~5000 at once [thanks for the bad algorithms + uninformative error messages, ArcMap!]. Dissolving everything together also failed. Instead I created a new integer field = objectID / 1000 and dissolved based on that field, giving me ~500 polygons. I repeated a similar procedure going to ~100 then ~20 then ~5 polygons until I was finally able to merge everything together. So, basically just a few rounds of dissolve. This may not fix every situation & Repair Geometry is a good idea too. But hopefully this can help others struggling.
... View more