The old .piopm in the “platform” folder (actually the package folder for framework-arduino-sam) is the problem. Just delete it. It somehow messes with the install.
And now, in regards what is actually the right way, let me show you how just create a minimalistic PlatformIO project that uses the official atmelsam platform that has your new variant and board definition. Because again, forking the platform is 100% overkill for that.
Awesome that worked! The instructions for modifying an existing package the right way would be awesome to have. I know the community would value that greatly!
And, if you did need to modify the framework package’s core/ or system files, you could still use a (pinned) version of the official atmelsam platform and then exchange the whole framework package with platform_packages and a symlink to a local folder in the project. The above is the most minimal one for your current case though.