Okay, was worried it might not be that simple. So you have everything loaded and updated. And you have the latest version of the plugin and WordPres? And it works in one environment but not the other. I tried to duplicate the problem but can’t.
So, I’m wondering if it is a hidden character or something messing things up. What happens if you delete the code in that file and type it from scratch as it is in the example code but not copy and pasting?