My money is on the yeast being mostly dead. Dry yeast is hardy, but it happens. If it was something else, there would have to be a gargantuan error somewhere in your process or equipment calibration to account for a fermentation stalled at 1.040, and this seems unlikely. Yes, it's a good idea to to de-gas the hydrometer sample, but if you don't, the bubbles only make a one or two point difference--not a 20 or 30 point one.
The haze/orange-juice appearance is from turbidity from the cells in suspension. Hopefully it's all yeast cells. If it were me, I'd taste a sample to make sure it's not infected.
Assuming it's fine, if the gravity doesn't move any further, you'll have to krausen it to salvage it. EDIT: Actually you probably won't need to krausen it, you'd probably be fine just sprinkling in more yeast, given that the beer is still mostly unfermented wort.