pkg upgrade tries to install sndio 1.7.0 (on 12.2). This fails with:
[1/16] Installing sndio-1.7.0...
===> Creating groups.
Using existing group '_sndio'.
===> Creating users
Creating user '_sndio' with uid '702'.
pw: user '_sndio' disappeared during update
pkg: PRE-INSTALL script failed
I found the issue. _sndio was in master.passwd but not in pwd.db.
After running pwd_mkdb it installed fine.
I have no clue where the inconsistency came from.
Glad to hear you figure it out.
Closing since it is resolved and there are no more notifications about this.