https://github.com/CMahaff/lasim
Profile transfer tool
There is already a tool for this.
Other than the issues with old lemmy instances having this bug, make sure your activitypub is setup correctly to return JSON.
https://github.com/CMahaff/lasim