I find that stealth can be a bit random in Skyrim. I was on the quest to assassinate the Khajiit caravan target. They were camped outside of Markarth, I shot in with an arrow from right across the river, up a hill, in 'hidden' sneak mode. Soon as the arrow hit him the rest of the caravan immediatley knew that it wa I that slew poor kitty. That is but one example of many
When I had that quest they were camped at Whiterun. I went up to the target to see if there was a dialog option to get him riled up. I don't think there was, or I missed it. At any rate, whatever dialog was available before was gone and he just made quips. So I sighed, left the camp, went into sneak mode, returned and decapitated him. No real surprise that the pigeon was now among the cats!
I ran toward the town gate, the guards saying, "A fight!" "This outta be good," or "My money's on the big one." Now you know the Khajiits say they aren't welcome in town, right? I ran through the gate and they came after me. Guards did nothing, unless we got close, then they ran away. Finally I ducked into Breezehome, went upstairs and hid behind Lydia for a while. I eventually went outside, and there they were, sauntering back to the gate, friendly as usual. Ri'saad was even willing to do business with me right then and there.