Why is creating users with OAuth2 authentication not allowed?

I am migrating about 8-10 thousand users to a Nextcloud instance.

I am therefore writing a program to transfer the users across.

I orgininally decided to use OAuth2 Bearer authentication, but it doesn’t work - I keep getting StatusCode: 401, ReasonPhrase: 'Unauthorized'.

Turning debug logging on, and following the trace back, I discover that creating users has a confirm password setting, and it seems the only way to make it work is to use Basic authentication, as that is the only one which sets the flag to say the password has been confirmed.

Why is this?