javascript – XML ​​error when searching for an item in the SharePoint list

I use a custom JS (borrowed) to display repeated sections in a more readable format, which is not a problem. However, when using the search field, an invalid XML error is returned …

TypeError: Can not set property 'innerHTML & # 39; undefined or zero reference
TypeError: Can not set property 'innerHTML & # 39; undefined or null referenceTypeError: Unable to get the property '_events & # 39; _events & # 39; _events & # 39; undefined or zero reference

When you delete the JS script below, the search results work correctly.
Can you please suggest what to try …