gh-2399 prevent casting for discriminator models when pushing to array