Why do I get - "not-null property references a null or transient value" error?

The first save does Ok, and the ID is created. So I dont understand why does it says that the ID is null in the second save.

 

the ID has been created in the first table, as you can see here  

  Discussion posts and replies are publicly visible