gh-154196: Improve `AttributeError` messages from unresolved lazy imports (#154688)