I hope you've had progress since this is a few weeks old now, but in case others are hitting this same problem, as I was, and finding this unanswered question, here are my findings so far...
The blog post you reference is really useful for getting started, however it's written from the point of view of implementing the Sign In With Apple button on the web, not in your iOS app. From your post, I think you're doing the same as me, and trying to authorise a user on your own servers by hitting the `auth/token` endpoint.
In this case, the `ASAuthorization` framework in your app will be making a token using your app's Bundle ID, not your services ID, and your client secret has to match that.
The fix for this is to generate a second client secret, using the same script and settings as per Aaron's blog post, except with your app's Bundle ID in the `sub` field of the settings. Then, when you're submitting an `authorization_code`, make sure you use the correct `client_id` in the request body, and the `client_secret` which matches that ID.
If you do this and get either `invalid_grant` or a success response, you've made progress. `invalid_grant` seems to be the next error in the chain, and is raised after client validation is passed.