Pixel 4a : adb detects device but fastboot command doesn't work This is a self answered question that is different and may save hours of frustration to somebody
Related questions but none that helped

ADB detects my device but fastboot doesn&#39;t
Yureka fastboot not detected in LINUX, but adb detects device
ADB detects but, fastboot does not detect device in windows 10
adb can find device but fastboot cannot
fastboot not showing device (nokia 2.1 ) but adb works fine
adb devices show phone in debug mod but not in fastboot mod
Fastboot detects phone in the fastboot mode but not when phone is on

My situation

After more than 6 months I thought of updating security patches on my Pixel 4a Android 11 (stock)  and root it again.

I uninstalled Magisk , applied OTA update , extracted boot image and patched it with magisk (see this). All smooth


Problem
I needed to run fastboot flash boot patched.img to root the device. But when I run the command response is &lt;waiting for any device&gt;, which was strange since adb devices shows device serial.
Things tried, without any luck

Updated adb on Lint Minux, it was latest

Switched to Windows 10 and updated

Andrew in chat pointed to an XDA thread, which was better covered by Izzy here How do I get my device detected by ADB on Linux?. Added udev rule but then no dice.

Firelord in chat suggested it could be plugdev issue so tried the solution mentioned in this Stack Overflow question adb devices =&gt; no permissions (user in plugdev group; are your udev rules wrong?), though the problem wasn't similar

Multiple cables , rebooting Android, Windows, Linux when I was at a loss to figure out

Variations of fastboot like fastboot flash boot_a patched.img, fastboot flash boot --slot all patched.img and sudo fastboot devices


Finally, the solution ....
I have now idea why this worked. Before running fastboot commands rebooted device in download mode:

adb reboot bootloader to get into fastboot
fastboot devices shows device serial
fastboot flash boot patched.img works :)
fastboot reboot to get back to normal device state
Device is rooted and I see su permission requests

Note: Some devices of LG and Samsung lack fastboot functionality.