When you can find a pattern for that error, please also tell us what version of JOSM you are using.

And have you already investigated all tickets (open and closed ones) about JOSM at http://josm.openstreetmap.de about that error?