SendEvent in InstantSearch Hits Widget

I’ve setup an instantsearch searchbox with default hits widget and everything is rendering great. However, when I add some template code as per examples I’ve seen for insights it doesn’t seem to render the onclick HTML in the hits container.

This is my template

            item: (hit, { html, sendEvent }) => html`
                <div class="product" data-id="${hit.objectID}">
                    <a href="${hit.url}">
                                ? hit.thumbnail
                                : "/wp-content/uploads/woocommerce-placeholder-150x150.png"}"
                    <div class="hit-name">
                            onclick="${() =>
                                sendEvent("click", hit, "my-click-event")}"
                            Click event
            empty: "<div>No results have been found for {{ query }}</div>",

I can send insight events manually and they appear in the events debugger via this JS

aa('clickedObjectIDsAfterSearch', {
    //userToken: 'user-123456',  // required for Node.js
    eventName: 'clickedObjectIDsAfterSearch',
    index: 'wp_product',
    //queryID: 'queryID',
    //objectIDs: ['objectID-1'],
    //positions: [2],

Maybe I’m not understanding how to correctly setup insights…

I can see the clickEvent when inspecting but it doesn’t seem to send any network events to Algolia when clicked.

Update, I loaded the JS via the CDN for insights and not locally and now everything works as expected. Not sure why it’s not working when I enqueue the JS locally…