Fixed EZP-18195: $result.object is not correctly created (part 2)

Regression from incomplete commit: https://github.com/ezsystems/ezpublish-legacy/commit/4652d45ca637239b4aaa8242fef24d7b6e08b7a6