Short answer: There are variant spellings for some of these greetings, and which one is used here is probably just an accident.
Lots of details:
Dutch has almost but not quite lost the case system that it started with when it branched off German, and that is still fully preserved in Standard German. I believe until relatively recently it was still expressed in writing, though not in the spoken language. In some fixed expressions the case endings are still present.
The greetings in question are short for "I wish you a good ...", so they once required the accusative case. Here are the German greetings (there is no equivalent for goedemiddag) and their Dutch cognates:
- Guten Tag - goedendag
- Guten Morgen - goede[n]morgen
- (Guten Mittag) - goede[n]middag
- Guten Abend - goedenavond
- Gute Nacht - goedenacht/goeienacht
You can see that the n, which in modern Dutch doesn't make sense, is optionally dropped before m. Nacht being feminine, goedenacht never had the extra n. (Goei is a colloquial variant of goed. I don't know why it's more commonly used with night than in the other greetings.)
Mahlzeit is the meaning that one would guess coming from German, but middag is a false friend. It can mean midday/Mittag in the temporal sense, but it usually means (even late!) afternoon. So the best German translation would probably be Guten Nachmittag, though that's not something you can hear often. (Most people just say Guten Tag in the afternoon.)
In Europe, basically everything goes when it comes to the various variants of r. We used to roll all of them, but centuries ago a new r (French r) started spreading from Paris. By now it has (in modified form) mostly but not completely taken German (some pockets of resistance) and has even reached the first Slavic language (Czech). A recent trend in German is to replace r by a vowel in words such as morgen: moagen.
Basically everything will be understood. Embrace your accent!
Have a look at this website, which includes audio examples and explanations of all the Dutch sounds: