jsyk, with how ActivityPub works changing the software that’s running from under it will break federation with you in all sorts of subtle ways. When you pick a thing to run under a domain you’re effectively locked into running that software under that domain. And of course there is some cryptographic verification as well so you change the keys (or you wipe or forget to back up the database) you may as well burn that domain from federating ever again.
It’s possible by having the webfinger endpoints at the “root” while keeping the rest of Lemmy on a subdomain. The main thing that determines the domain in your username is webfinger.
No clue if Lemmy or kbin support this config though, but quite a bit of the microblog-only parts of fedi do, and it’s a widely used thing.