[jit] Try to mitigate bad_weak_ptr error from type ptrs and print more error message. (#102822)
Test Plan: CI
Differential Revision: D46385190
Pull Request resolved: https://github.com/pytorch/pytorch/pull/102822
Approved by: https://github.com/Skylion007