I've only had EDE attacked randomly once. I reloaded and it didn't repeat.
Random attacks on EDE just seems to be a bug.
It happens damn near everytime I go to McCarran, not as much now that I make him wait outside, but I'd prefer not to do that.
Out of the blue theory here. Did you ever give ED-E a Legion uniform? At which point the game might have told you "this follower can't wear faction whatever" and it disappeared from his invetory?
I tried making a companion carry a faction uniform early in that game and never did it again one I realized they can't even carry them.