What happened is correct behavior.
Note Treasure Map's text (with my ephasis):
Trash this and a Treasure Map from your hand. If you trashed two Treasure Maps, gain 4 Golds onto your deck.
On the second playing of the Treasure Map, you didn't trash 2 Treasure Maps, you only trashed one from your hand. The one you played was already in the trash from the first playing.
The difference to the Throne Room + Feast scenario you linked to is that Feast has no causal relationship between the trashing and the gain. The bold part shows that this is different for Treasure Map.
This is mentioned in the answer by Pat Ludwig there, who quotes:
Gaining the card isn't contingent on trashing Feast; they're just two things that the card tries to make you do.
For Treasure Map, as the bolded text shows, gaining the Golds is
contingent on both Treasure Maps being trashed.