Assuming @bricksonemore is right about the issue being jQuery, please note that jQuery in WordPress is in compatibility mode. You can get around that by replacing $ with jQuery in the code. Or just ask chatGPT to adjust the code to work in compatibility mode.
FYI jQuery being in compatibility mode is a WordPress thing, not a Bricks thing. In case you run into this elsewhere in WordPress.