Primary group class not available on "Not Found" page

We’re using the primary group class name on the body tag to customize some layout for certain groups.
However, on the “Page not found” page, this class is not being injected?