Hello,
How did you add that code to the shop page? Using default text editor? Because by default Elementor does not allow edit shop page using simple option Edit With Elementor. You can edit shop archive page using only Elementor Pro and archive template https://elementor.com/help/creating-a-woocommerce-archive-template/
If you want to use the default shop page template but just display additional information above the products then create Static block with the necessary content using Elementor and go to Theme Options > WooCommere > Shop > Shop page layout > Shop Page Banner Content > add the static block shortcode.
Regards