Sneak attack seems a bit wonky and or broken atm for exactly the reason you've mentioned. You should get sneak attack out of stealth but you don't reliably. I dont think it works if you are hiding once combat begins, but i'm not sure.