It's my understanding that this kind of thing, possibly combined with actual code quality concerns(?), is exactly why they're replacing the scp protocol with sftp; as https://www.openssh.org/txt/release-8.0 notes,
The scp protocol is outdated, inflexible and not readily fixed. We
recommend the use of more modern protocols like sftp and rsync for
file transfer instead.