Fixed a regression with get_or_create and virtual fields.

refs #20429

Thanks Simon Charette for the report and review.