Hi @mweterings
Thanks for the post.
Your code looks correct, perhaps you could try getting the user id using a different WP function such as get_current_user_id().
This is explained in detail here: https://codex.wordpress.org/Function_Reference/get_current_user_id