Expand/Collapse not working on published site

You do not have that element on your site. As you can see from the Mobile view in the Editor:

You will first need to add this element to the site, and you can then access from code.