The package manager correctly identifies that A and B both need to be upgraded, and starts by installing the new version of B.
After installing B to disk, the DE crashes (for orthogonal, unrelated reasons - it's still using the old version of B in memory). If you restart your DE without rolling back the update, your DE will probably crash, since it now only has access to the new version of B, and not the old version of B which the old version of A depended upon.
I've seen fonts go nuts, backgrounds disappear, general themes not working etc.
Both fedora workstation (ostree) and suse transactional updates (btrfs snapshots) can update the system while it's running but commit the update only on the next boot.
While at it: this is not a problem with dnf only, it's a problem with basically all package manager.
After resolving dependencies all there is left to do is copy files to their places.
In the Pandora's box horror of a Windows Update there's nothing clean about the process. And as i have to administer some Windows Servers, almost every, even smallest update or change requires restart "your PC".