What is the most efficient way to replace a 14" rough-in toilet with a 12" rough-in toilet?
Toilets do not require any stability from a wall or any other surface other than a flat floor to set on. Even if the floor is not, shims can be used to correct that.

The 14" rough in, with a 12" toilet will leave a 2 1/2" to 3" gap at the wall, nothing else

You still can order toilets with a 14" rough in, try a plumbing supply, not the big box stores.

The tank from the 14" toilet may work on a 12" bowl, but toilets are sold with tanks typically together, not separate from their tanks.