That is not possible. The update is first to the latest version of the actual Nextcloud release. Today for Nextcloud 27 the version 27.1.8 will be shipped. Hopefully it works then If not post some errors.
… this command provides information about various updates in a fairly conversational way, including whether an update is available for apps and not just about updates for the server core.
Parsing various data collected in different ways is one of the basic techniques that you should master if you want to write (Bash) scripts. This is not a Nextcloud-related topic but rather about learning Bash in general.
What I would like to advise you, however, is that if you are already having difficulties with this simple basic technique, then I would definitely not leave something as sensitive as updating your Nextcloud server, where so many things can go wrong, to a script. There should be a number of similar tests that must be carried out to check the status of the update, the results of which should then be used to make further decisions, such as a rollback or abort, etc.
After all, you don’t want your server to suddenly become unavailable, do you?
These results can now be easily parsed for patterns. You don’t even need any knowledge of regular expressions, as this version can be divided into numbers.
I can explain all of this to you, but I feel a little strange because it’s explaining a language and doesn’t really belong here.
But I don’t want to leave you out in the cold like that. Therefore, here is a hand-picked series of sources from which you can familiarize yourself with all the techniques of bash and shell scripting.
Bash Guide at TLDP: The Bash Guide on The Linux Documentation Project (TLDP) provides a comprehensive introduction to Bash programming along with many practical examples. You can access it at http://tldp.org/LDP/abs/html/.
Bash Academy: An interactive online platform offering free courses on Bash programming. It provides a blend of lessons and hands-on exercises. Visit https://guide.bash.academy/.
Shell Programming at Wikibooks: The Shell Programming book at Wikibooks offers a solid introduction to shell scripting with plenty of examples and explanations. You can read it at https://en.wikibooks.org/wiki/Bash_Scripting.
Bash Scripting Cheat Sheet at Devhints: Devhints offers a handy Bash scripting cheat sheet containing quick references to commonly used commands and syntax. You can find it at Bash scripting cheatsheet.
Bash Scripting Tutorial at ShellCheck: ShellCheck provides a tutorial on Bash scripting along with a handy shell script analysis tool to improve script quality. Access it at https://www.shellcheck.net/.
Bash Scripting Guide at Ryanstutorials: Ryanstutorials offers a comprehensive guide to Bash scripting with step-by-step explanations and practical examples. Explore it at Bash Scripting Tutorial - Ryans Tutorials.
and last but not least, the source of most of my knowledge, the man pages: