Solved the issue: had to enable MTP in TWRP and then ADB started working immediately.
I looked more into this. The issue is actually independent of MTP being enabled or disabled: it breaks every time you reboot your phone into recovery from OS while USB cable is still plugged into your PC regardless if MTP is enabled or not.
XDA Developers was founded by developers, for developers. It is now a valuable resource for people who want to make the most of their mobile devices, from customizing the look and feel to adding new functionality. Are you a developer?