wp_register_script() and wp_register_style() 4th parameter (version) not working for logged out users

I’m enqueuing scripts and styles from functions.php in my custom theme. The 4th parameter is the version number. It’s working only for logged in users.

wp_register_script( 'my-handle', get_stylesheet_directory_uri( __FILE__ ) . '/js/my-script.js', array( '' ), filemtime( get_stylesheet_directory( __FILE__ ) . '/js/my-script.js' ), true ); wp_enqueue_script( 'my-handle' ); 

Logged in:

<script src="https://mysite.com.local/path/to/my-script.js?ver=1614637944" type="text/javascript"></script> 

Logged out:

<script src="https://mercury.photo/wp-content/plugins/instagram-feed/js/sbi-scripts.min.js" id="sb_instagram_scripts-js" type="text/javascript"></script> 

Caching plugin on the live site is LiteSpeed Cache. The local dev site uses no caching. Same output on both sites.