Hi Jonatan ,
Glad that you figured out the way to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Replacing Null-values with the dummy value of '-1' helped resolving the issue.
Kindly accept the answer by clicking on
Accept answer button so that the solution reaches the community in case anyone is facing similar issue. Thankyou.