Fixed #23370 -- defer() fails with inherited models