don't call const_factory for builtin types subclasses, this will trigger error later. Closes #124337 [applied]