What you're asking, instead, is whether such behavior would be a violation of ethics, which I interpret to mean professional ethics. That is, what an idealistically-respectable member of your profession would do.
Typically, unless there are powerful conflicts between laws and ethics, professional ethics require one to act within the constraints of the law. Violating copyright to save a few bucks wouldn't typically be considered a powerful conflict. So, if you're confident it'd be illegal, then it'd be unethical, too.
Some professors appear to navigate this maze of morality, legality and ethics by giving their students a warning with a wink and a nod, like "The preprint copy at [link] may have been removed. If so, please do not download it from the wayback machine, nor the current edition from sites such as OpenStax, BookBoon, vk, LibreTexts, or similar".