We are not able to help further with adding custom code from that article on .org, so you will need to reach out to a local WordPress developer to help you. You could test by temporarily deactivating all plugins, other than Paid Memberships Pro and the Courses Add On, and test whether this issue persists. You can either deactivate them temporarily in bulk or work through them one by one. If the issue persists from there, revert to the default Twenty Twenty One theme. If the issue is resolved after deactivating a specific plugin or your theme, you’ll know that is the source of the conflict.
If you can install plugins, install Health Check. On the troubleshooting tab, you can click the button to disable all plugins and change the theme for you, while you’re still logged in, without affecting normal visitors to your site. There’s a more detailed description about how to use the Health Check plugin and its Troubleshooting Mode in this article: Troubleshooting using the Health Check plugin.
When you identify the problem, I suggest getting in touch with the plugin or theme author.