Bring a large pot of salted water to a boil. Add the green beans and cook, uncovered, until fork-tender, 15 to 20 minutes. Drain.
Melt the butter in a large saucepan over medium heat. Add the shallots and cook, stirring, until lightly browned, about 5 minutes. Sprinkle the sugar over the shallots and cook 1 minute longer until the sugar carmelizes. Be careful not to let it burn.
Add the water. Cover and let simmer for 10 minutes. Dissolve the cornstarch in the vinegar and add it to the shallots. Bring to a boil, stirring constantly. Remove from the heat and season with salt, pepper, and nutmeg.
Add the green beans to the shallots, mix well, and heat through. Adjust the seasoning. Sprinkle with parsley and serve.