Yep, seems like it, but I canât really say, because I use https://deb.sury.org/ for PHP.
However, I would probably try to upgrade Debian to Bookworm and then try to upgrade Nextcloud via CLI Updater. If that doesnât work, you could still try to upgrade manually. If that doesnât work either, you hopefully have a snapshot of your VM, in order to easily revert back to the previous state.
If you want to be 100% sure that no issues will occur due to a wrong PHP version, install PHP 8.1 from https://deb.sury.org/ and upgrade to NC26, before upgrading Debian.