Perhaps this is related to the following issue:
DNF operations use large amount of RAM and may fail in low-memory environments
You can usually complete the interrupted upgrade like this:
F38upgrade error; System Is full of duplicate packages after update - #17 by vgaetera