So no need to disable modules or anything?Just sharing how I do it in case someone is interested in a shorter path:
1. Download the new full factory image
2. Extract the file. Then extract boot.img from the image zip file within.
3. Copy boot.img to your pixel 5
4. Patch it with magisk
5. Move back the patched file, rename it to boot.img
6. Update the original zip file titled image-redfin-r*.zip with the new boot.img file (override the older one)
7. Edit flash-all file by removing -w so it won't wipe your device clean
8. Flash with flash-all
No need to unroot and reroot.