https://github.com/torvalds/linux/blob/v5.18/drivers/scsi/sd.c#L3530
And sd_shutdown() in turn calls sd_sync_cache().
My guess is certain existing structure makes it inconvenient to have sd_shutdown() behave differently when called from sd_remove(), and since it doesn't pose any actual problem anyway, no one cares enough make it "better" (not to mention that making such "pointless" improvement could introduce regression if carelessly done).
But I could be wrong (as in, there could be good reason to call sd_sync_cache() anyway). Either way this kind of question belongs to the linux-scsi mailing list. Let alone whether it is out of the scope of this site, the devs there can give you much better answer on the why. Here you tend to get irrelevant answers. (Or worse, "your disk might be dying" / "check SMART" FUD.)
By the way I think the real concern here is, does unmounting / sync (as opposed to sg_sync from sg3_utils) guarantees that the on-device writeback cache is flushed (instead of just on-memory dirty pages)? I don't think Linux could bear such a flaw, but I do run sg_sync after unmounting sometimes (because I'm a paranoia). (EDIT: See https://github.com/torvalds/linux/blob/v5.18/drivers/scsi/sd.c#L1249)
In case it's not obvious enough, whether you see the message does not depend on whether the cache is empty. AFAIK there is not even a way in SCSI or ATA to check that. Also udisksctl is NOT relevant here, you'll see the message even if you just disconnect the drive.
For the record, the fact that sd_shutdown() is called in sd_removed() (and that sd_sync_cache() is called in sd_shutdown()) dates back to earliest git commit of the upstream kernel. Back then sd_shutdown() does nothing more than sd_sync_cache(). And according to the comment for sd_remove(), it seems that at least one reason to call sd_sync_cache() in sd_remove() is that sd_remove() is not only called when (after) a disk is detached, but also when the scsi disk module is unloaded, in which case SYNCHRONIZE_CACHE will NOT fail. But from my POV, whether SYNCHRONIZE_CACHE could ever be really necessary when sd mod is unloaded is still in question, as I'm not sure if that's even possible when there is a mount that involves a filesystem on a SCSI disk.
But again, AFAICT, if we want to "suppress" SYNCHRONIZE_CACHE from being sent in the case of sd_remove(), we'd need to e.g. set sdkp->WCE to 0 in it, which might be, semantically speaking, sort of dirty.
It's also hard to say whether the other stuff that the current sd_shutdown() does is ever necessary in the case of sd_remove() either. (I mean, the reason that it is called might be completely historical.) But again again, I doubt that any devs would bother to risk a regression when everything has been fine and harmless.