If you hide a unit locally for one player, then any interactions that the unit does will cause a desync. Hidden units can do very few things, so when the controlling player orders the unit to do anything, those orders might not be reflected in the "hidden" version. Wc3 notices that the unit is out of sync between players, and kicks people.
That is why it is pretty much necessary to do something relating to invisibility. But it is actually a lot of work. I think I implemented something for it a long time ago, but I don't remember the details. Here are some pointers:
(1) Invisibility can be detected. Use that to your advantage. Let's say you want to hide a unit for all players except two. One way is to make a dummy unit for those two players with some sort of invisibility detection (with a very low sight radius), and periodically put it near that unit (e.g. every 0.03 seconds).
(2) Hiding projectiles is difficult. It is tough to do without triggering projectiles themselves.
(3) If two invisible units are stacked on top of each other, you might end up with a situation where you end up seeing units you shouldn't see. In my case, that wasn't possible because the hero was unique. But it might be possible in your map. It depends on what you want to hide the unit for.
(4) If you want invisibility detection in your game, you'll have to trigger it using a similar method (create a dummy unit and place it close). This is so that you won't see the units you want to be "hidden".
(5) Add the ability "Ghost" and "Permanent Invisibility" so that the unit will stay invisible even while attacking.
Experiment with it. It requires a lot of testing, but it worked decently well (I think) when I implemented it back then.
P.S. Moving to WEHZ.