Yes. that's exactly how it works.
The problem is that some legacy web pages test for document.all as a way of checking for IE. The JS code then has two code paths: one for IE and one for other browsers. Other legacy pages however, use document.all blindly assuming that it only needs to work with IE, because it was created at a time when IE was the overwhelmingly popular browser in use.
Since the latter pages would simply break in non-IE browsers, which is not good for the market share or reputation of those browsers, they implement document.all() to cope with them. But because in the former case they want the JS code to follow the non-IE code path, for document.all itself (and several other similar way of testing for the presence of document.all) they return "undefined".
For the details, see The HTMLAllCollection interface and The [[IsHTMLDDA]] Internal Slot