This code looks very familiar! Which makes me think that you’re seeing the same error as the OP but for a different reason. We worked through something similar over here:
Want to check out that thread and let us know if it helps you resolve the issue?