Fact stranger than fiction. I’ve had to trouble shoot a lot of strange stuff and usually, it finally makes sense. This is one of those that still doesn’t. The issue has nothing to do with your Plugin. Your questions about Themes and Plugins caused me to do a lot of testing.
I have several WP installations with different themes and so I went to another theme that had the fewest Plugins. Your Plugin worked perfectly. That narrowed it down to the Plugins on the site I originally tried this in which is my most complex website as far as the backend goes. I have Redirection and it was showing continual redirects of this page though I had not added a redirection for this page.
What I had noticed from the beginning was that on this particular page and only this page, the permalink was being reset to have an .asp extension. Even if I told the permalink what extension I wanted the .asp would be added on (I use the WP Extension Plugin to define extensions on pages so I can match some page titles to an older website with 301’s).
The default is no extension which is what I was doing. The Plugin was correctly set to no extension. But the .asp was being added causing the page to never be found. If I then set the extension as something like .htm, it would turn around and create a page that was .htm.asp !!!
Another Plugin I use is Permalink Finder. It appears that for some reason when your shortcode is used in a page, Permalink Finder believes this page should have a .asp on it and so it was redirecting the permalink with a .asp added onto the existing permalink even if the permalink already had an extension.
The solution, as strange as it may seem, is to make the pages permalink have an .asp extension to begin with. Then Permalink Finder is as happy as clam and does nothing.
Which leads to a fascinating question. What is it about your code that causes Permalink Finder to insist the page should have a .asp extension on it. This hasn’t happened on any of my other pages on any website even media and music intense ones. So I’m thinking there is some type of conflict between your code and Permalink Finder that forces it to do this. Just a guess at this point.
So I’ve fixed the problem and understand who the culprit was but I don’t have a clue as to why it was occurring. And that still bothers me.
Gee, life was so much less stressful before computers wasn’t it?!