I've looked at the code now, and the places where I was able to recreate the error (In the Kurs (Course) content class), on the Deltakere (Participants) relation, the error was due to a function that is executed in the OnNew method. The method had a line that used WAFContext. WAFContext is dependent on being used in a Web context, but when you click the New button, the node is created in a workflow context.
The solution is very simple: Use the Session property on the node object, and not any context objects.