ADB Shell In Recovery Mode - Error:Closed
You're not doing anything wrong. You're most likely using a stock recovery. Access to shell can prove to be  potentially dangerous when it comes to userdata so a lot of OEMs or vendors (I don't know the correct term) prefer to ship a locked-down stock recovery which would do what OEM wants them to do, such as flashing OTA updates, sideloading updates from OEM, doing factory reset and in some cases, some hardware testing options. That's the scope they follow.

If you want unconditional shell access, you would've to flash a custom recovery.