Object insert popup shows categories when no instances under it can be inserted

Bug
Categories in the object insert popup always display even if no instance under them can be inserted.
0I4f21jBkH

Expected behavior
Categories should only display if one or more instance in that category can be inserted at the time.