Did the formation of Panama trigger the beginning of Ice Ages?
The closing of the Isthmus of Panama alone did not trigger the beginning of the Ice Age, but it is a potentially decisive step on the way of ice shield build up in the north.
The development that leads to the current Ice Age, per definition a phase in earth's history were polar and continental ice shield build up, starts much earlier. Cooling began after a greenhouse phase already 60 million years ago at the end of the Cretaceous, possibly because of declining atmospheric CO2 levels. Intense volcanism (flood basalts) and the Chicxulub impact surely have contributed to peak cooling at that time.
During the late Paleogene and Neogene, Around ~40 - 30 Million years ago Antarctica and Australia separated and the Drake Passage opened, enabling an Antarctic circumpolar current (ACC) that isolated Antarctica from global circulation. Though the role of the current is debated, it coincides at least partly with ice shield buildup in Antarctica, but declining CO2 may have played an equal or even bigger role. The uplift of the Tibetian plateau may have contributed to cooling by chaning continental circulation patterns. Reason for the CO2 carbon decline in the late Paleogene/early Neogene may be increased silicate weathering in the course of the Himalayas and the Alpine orogeny.
So, when the Isthmus of Panama closed (exact date debated), it was already pretty cold compared to the Cretaceous and an ice shield covered Antarctica. The closing is hypothesized to have steered the gulf stream farther north, enabling the transport of moisture and warm air to the north and thus ice shield build up there.
We also should keep in mind generally ice shield buildup has a feedback in itself by rising the albedo, thus reflecting more energy back to space.
It is a complicated path to the current Ice Age with a lot of facets, starting in the late Cretaceous.