Edit due to solution found.
I just figured out theat when adding the relationship extension I must not have any element within the page selected. If there is the relationship wizard failes to generate the correct code. Not sure if you have experieced this before but. After several hours of testing i finally found why!