Homebrew cask developers deleted pre-maverics dependencies support due to the high maintenance overhead and it looks like they introduced a bug.
The way to fix it is to run:
/usr/bin/find "$(brew --prefix)/Caskroom/"*'/.metadata' -type f -name '*.rb' -print0 | /usr/bin/xargs -0 /usr/bin/perl -i -0pe 's/depends_on macos: \[.*?\]//gsm;s/depends_on macos: .*//g'
You can find this solution, the reason for this error and more info in:
https://github.com/Homebrew/homebrew-cask/issues/58046