Unable to remove VirtualBox

“sudo dnf remove VirtualBox*” gives me error “Unsupported argument for REMOVE action: VirtualBox-7.1-7.1.8_168469_fedora40-1.x86_64.rpm”

Put quotes around 'VirtualBox*'. Otherwise the shell will expand the wildcard if it finds a matching filename in the current directory.