Partly revert 91b30a001b79096b60d9424a4664a417dce0b767
Partly revert 91b30a001b79096b60d9424a4664a417dce0b767

Actually `reflection.klass` should be valid AR model unless
`polymorphic?`. Previously it worked limitedly by ignoring `NameError`
even if `reflection.klass` is invalid, and our isolated testing depends
on the limited working.
Probably we should also check the klass validity in `check_validity!`
properly. Until that time, I restored the error suppression for now.

Closes #32113.

mohitnatoo/rails,yhirano55/rails,bogdanvlviv/rails,yhirano55/rails,eileencodes/rails,MSP-Greg/rails,flanger001/rails,Stellenticket/rails,kddeisz/rails,utilum/rails,utilum/rails,esparta/rails,rails/rails,illacceptanything/illacceptanything,mechanicles/rails,illacceptanything/illacceptanything,printercu/rails,shioyama/rails,kddeisz/rails,flanger001/rails,Edouard-chin/rails,bogdanvlviv/rails,untidy-hair/rails,shioyama/rails,untidy-hair/rails,aditya-kapoor/rails,rafaelfranca/omg-rails,utilum/rails,yahonda/rails,iainbeeston/rails,illacceptanything/illacceptanything,palkan/rails,shioyama/rails,joonyou/rails,yalab/rails,tgxworld/rails,pvalena/rails,fabianoleittes/rails,gfvcastro/rails,illacceptanything/illacceptanything,starknx/rails,iainbeeston/rails,georgeclaghorn/rails,yahonda/rails,arunagw/rails,betesh/rails,BlakeWilliams/rails,BlakeWilliams/rails,joonyou/rails,illacceptanything/illacceptanything,joonyou/rails,deraru/rails,Edouard-chin/rails,deraru/rails,georgeclaghorn/rails,EmmaB/rails-1,pvalena/rails,gfvcastro/rails,tjschuck/rails,kmcphillips/rails,tjschuck/rails,esparta/rails,Vasfed/rails,esparta/rails,illacceptanything/illacceptanything,Envek/rails,illacceptanything/illacceptanything,pvalena/rails,betesh/rails,yhirano55/rails,Envek/rails,betesh/rails,illacceptanything/illacceptanything,tjschuck/rails,tgxworld/rails,yahonda/rails,travisofthenorth/rails,MSP-Greg/rails,rails/rails,utilum/rails,yalab/rails,starknx/rails,Stellenticket/rails,repinel/rails,schuetzm/rails,schuetzm/rails,MSP-Greg/rails,tgxworld/rails,printercu/rails,bogdanvlviv/rails,mohitnatoo/rails,vipulnsward/rails,illacceptanything/illacceptanything,prathamesh-sonpatki/rails,Envek/rails,lcreid/rails,mechanicles/rails,yawboakye/rails,assain/rails,joonyou/rails,Vasfed/rails,kddeisz/rails,arunagw/rails,flanger001/rails,EmmaB/rails-1,pvalena/rails,baerjam/rails,illacceptanything/illacceptanything,jeremy/rails,schuetzm/rails,yahonda/rails,repinel/rails,yawboakye/rails,baerjam/rails,vipulnsward/rails,repinel/rails,fabianoleittes/rails,eileencodes/rails,mohitnatoo/rails,prathamesh-sonpatki/rails,palkan/rails,illacceptanything/illacceptanything,mohitnatoo/rails,yalab/rails,gauravtiwari/rails,Vasfed/rails,arunagw/rails,arunagw/rails,rafaelfranca/omg-rails,kddeisz/rails,untidy-hair/rails,EmmaB/rails-1,yhirano55/rails,yawboakye/rails,starknx/rails,iainbeeston/rails,vipulnsward/rails,illacceptanything/illacceptanything,assain/rails,kmcphillips/rails,baerjam/rails,kmcphillips/rails,Erol/rails,travisofthenorth/rails,eileencodes/rails,gauravtiwari/rails,Erol/rails,Edouard-chin/rails,assain/rails,illacceptanything/illacceptanything,aditya-kapoor/rails,printercu/rails,MSP-Greg/rails,gfvcastro/rails,yalab/rails,assain/rails,Stellenticket/rails,yawboakye/rails,jeremy/rails,lcreid/rails,aditya-kapoor/rails,mechanicles/rails,Edouard-chin/rails,lcreid/rails,iainbeeston/rails,prathamesh-sonpatki/rails,baerjam/rails,notapatch/rails,lcreid/rails,tgxworld/rails,jeremy/rails,travisofthenorth/rails,BlakeWilliams/rails,eileencodes/rails,illacceptanything/illacceptanything,shioyama/rails,esparta/rails,notapatch/rails,georgeclaghorn/rails,tjschuck/rails,Erol/rails,aditya-kapoor/rails,Erol/rails,Stellenticket/rails,BlakeWilliams/rails,printercu/rails,betesh/rails,gauravtiwari/rails,palkan/rails,mechanicles/rails,Envek/rails,notapatch/rails,repinel/rails,prathamesh-sonpatki/rails,georgeclaghorn/rails,rails/rails,Vasfed/rails,untidy-hair/rails,rafaelfranca/omg-rails,deraru/rails,rails/rails,jeremy/rails,palkan/rails,notapatch/rails,deraru/rails,flanger001/rails,gfvcastro/rails,bogdanvlviv/rails,kmcphillips/rails,schuetzm/rails,fabianoleittes/rails,fabianoleittes/rails,travisofthenorth/rails,vipulnsward/rails,illacceptanything/illacceptanything