It's probably caused by MagiskHide changing ro.debuggable to 0. It needs to be set to 1 for adb root to work.

You can either disable MagiskHide (and reboot), or change just that prop back to 1 with a boot script or MagiskHide Props Config (it's in the Magisk repo).

Reference

github