I’m not familiar with the Notion API, but one common reason for this sort of thing to happen is because the token expires. I don’t know how you’re retrieving the token, but to test this theory out, try retrieving a new one and use that in place of the current one. If everything starts working again with no additional changes, we can identify the token as the issue. If it’s still nil, we can work from there.
Have you tried running the request in another setting? Postman, cURL, axios, etc. If not you should. See if the results you’re getting are the same.
Also, if we assume that an unauthorized (403) request would return an error, then we can also assume that any 400 level request would return an error. This further implies (correct me if I’m wrong) that since your system is not erroring, it’s probably returning a 200, meaning that maybe it’s the data itself that you’re retrieving that’s resulting nil? Perhaps ensure that the data itself is not nil (i’m sure you already have but maybe one more time).