Please ensure you have correctly put this code snippet with the Code Snippets plugin or the similar one. Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, please ensure that caching is disabled for logged-in users. It was tested locally, and it seems to be ok. Please try to add two listings because there also can be a problem with the auto-draft listing, which was created before you added the code snippet