For anyone interested, i solved this.
If you want to copy a legend into a figure, the legend needs to be tied to its axis. To do this, you just have to create a vector, in which you copy the uiaxis and then the class "Legend" from the uiaxes. In my code that looks like this:
%create new figure
newfigure = figure();
% copyobj([Vector including the axis and the corresponding Legend],handle for the figure you want to copy to)
copyobj([app.UIAxes,app.UIAxes.Legend],newfigure);