It turned out to not be an issue in my code but an issue with the low-code environment I was working in, which didn't allow passing entire datasources via the parameters.