The page https://classic.yarnpkg.com/lang/en/docs/install/#debian-stable lists apt-get as an installation method for "Yarn classic". This installation method only works up to Debian 11 since apt-key add is not included in newer versions.
Could you update this information (if it is part of what you do) for (1) more modern Debian/Ubuntus and (2) newer yarn versions? Up to now I get the impression it's not possible at all to install modern yarn with apt-get.