Indeed.
One cannot remove the incident from the cleansing of the Temple. Israel is often depicted as a fig tree (among other metaphors). Add to this, Jesus' response about being able to say "to this mountain"--what mountain? The Temple mount.
This was a parable of judgement. The tree was deceptive--looking to be fruitful, but wasn't. Jesus took advantage of the condition and turned it into a teaching moment.
The cursing of the tree was a prophetic-parable which was in line with how the prophets of Israel typically taught.