It looks like you are searching via user_id which is API v5, so ensure you add ‘&api_version=5’ to the end of your API call (there may be a better way to handle it in AJAX but the above should work.)
When I do your call with my changes (https://api.twitch.tv/kraken/streams/40336240?client_id=XXX&api_version=5) then I get the {"stream":null} since they are not live right now.
If I take that same user_id (40336240) and use it in the /channels/ endpoint (both of which, use user_id in v5) I get the user "name":"summonersinnlive".
This is the /channels/ call I made: https://api.twitch.tv/kraken/channels/40336240?client_id=XXX&api_version=5
So I’m not sure where you see another streamer, I tried the same method with a streamer thats live right now (to ensure I wasn’t mucking anything up) and it gave the intended information, using v5 and the user_id, /streams/ returned the proper information for the live streamer.