Issue reproduced on a Hyva-theme.
The main cause seems to be the Yireo_GoogleTagManager2::product/details.phtml block which is not loaded on the catalogsearch_result_index.xml layout, so the window['YIREO_GOOGLETAGMANAGER2_PRODUCT_DATA_ID_' object is empty.
Also, some thinking has to be put into adding the index key on the products.
I might try to solve it by myself in the near future, but until then, I'll leave it here.