Issue described here: https://community.platformio.org/t/custom-target-for-mbed-atmelsam/9795
Fundamentally, variants_remap.json is a fixed platform file and does not support custom boards.
I propose adding a line to mbed.py allowing one to override the variant name derived from $BOARD and variants_remap.json.
variant = env.BoardConfig().get("build.variant", variant)