Apple Sign-In, securitycode endpoint returns 400

I'm currently trying to add Apple as a sign-in option to my webpage. In the last step of the sign in process, when entering the verification code, for the 2FA verification I get a 400 http error from the https://appleid.apple.com/appleauth/auth/verify/device/<deviceId>/securitycode endpoint, and it returns back to the login view, first step of the login process.


I don't know if there is something wrong with the initial request to the Apple sign-in service, but since I can reach it I think it should be fine.

I'm currently using a non-verified device, since I don't have an iPhone. I haven't been able to test this on a Mac or iPhone. Only PC and Android sign-in through the web.