It is from the Divertimento in C Major, Hob. XVI:1 by J. Haydn (doubtful).
M.D.C = Menuetto da capo
Sebastian I am pretty sure your notation reflects the original score - except that the C Minor key signature change might have been placed after the repeat bar-line.
If you made a System break after bar 20 you could hide the cautionary key signature.
yes, but it looks ugly - and is not correct for the second repeat..
In these cases one starts contemplating wether it would be better to put the Trio into its own flow…
In case of a Da Capo in a Menuetto movement it’s uncommon to write a cautionary key signature at the end of the Trio. Everybody is supposed to know and remember the key signature of the Menuetto.
I regard this proof reading case as a bit of “overguarding”.