Thank you Igustaw. I have tried Duplicate Post and duplicate now and found duplicate post works very well, while duplicate page also has part of the same problem as Duplicate TEC event. Is has a lot more checks too, like checking a users capabilities to see he is allowed to duplicate in the first place.
I also tested some more and examined the code of Duplicate TEC Event as a programming education project. I think I have found both the problem and a solution. Those that want to know or keep using this plugin may use it.
In more detail the problem was two way. After duplication:
1. In editor of the original event, the link to the fronted permalink was fine, while it showed and remembered the slug of the duplicate.
2. When viewing the original event as a single event, the edit permalink in the admin-bar referred to the duplicate event in stead of the original event. That gave me some Clues.
I examined how both duplicate-tec-event and duplicate-post duplicate the post and meta and found that duplicate-page and duplicate-post both use a new array in which they only fill the post-data that they need for a new post in stead of removing just the ID of the existing post and recreating it. The problem was that both the quid and post_name attribute stayed filled in that way.
an unset of $event[‘guid’] helped to correct the admin-bar problem.
an unset of $event[‘post_name’] helped to correct the permalink in editor.
I have found no data in the $event table to explain why wordpress changes the post_name that is offered in both the original and duplicate in the edit screen, but it must remember in some way that they belong together. Saving the duplicate doesn’t correct that, only changing and saving it in the duplicate. My only quess at this point is that if a post is created by wp_insert_post, that if the post_name offered already exists, wp gets confused. Or it may be a plugin like Yoast SEO that interferes. In the end I found only just unsetting both guid and post_name did the job.
Also I don’t know if wp_insert_post enters the event-meta too (although I think not), so offering that to it as an argument might be redundant and in that case the fallback coding updating the meta might be actually inserting it in the first place. Looking at the used API method of TEC (the object used is deprecated also), I found it to only call wp_insert_post anyway, so one could easily just call that directly.
And after all this I found that the duplicate-post is a better maintained and flawless an more complete plugin, so I too think at this point it is better used in stead of this plugin. And with one million+ installs it is better tested too.
It took me a lot of time to find the problem, but it was educational too (and that was my main motive). For those that want to use this plugin. You should edit the file duplicate-tec-event.php and insert two unset-statements where it unsets event[‘ID’]. The code could look like this:
unset( $event['ID'] );
unset( $event['guid'] );
unset( $event['post_name'] );
In that case wordpress just creates a new quid and post_name and all goes well. When you want to remember the original post_name in the duplicate, you should at least after insert call the wp_unique_post_slug() function to make it unique and use the wp_update_post() function to update the post-slug. You should probably just use the duplicate-post plugin though since this plugin does exactly the same and duplicate-post does it better.
Cheers.