The story as I perceived it back then (I'm German) is a bit different. Merkel felt compelled to find a humanitarian solution in 2015, and hardened her stance a year or two later when it became clear that the huge influx was socially and politically — not economically! — unsustainable.
The "Dublin Regulation III", its iteration in force in 2015, upheld the principle that "the first Member State where finger prints are stored or an asylum claim is lodged is responsible for a person's asylum claim."
Partly as a consequence of the increased migration into Europe in the wake of the intensifying Syrian civil war, this regulation was modified in 2020. The EC page linked states in bold that "no Member State should shoulder a disproportionate responsibility": The primary goal of the modification is to provide relief to the border states who until then were solely responsible for attending to asylum seekers.
Because "the peak of the [Syrian civil] war was around 2015", the number of refugees grew by an order of magnitude during the summer of 2015. It became quickly clear that the relatively small and poor countries in Europe's South-East were entirely overwhelmed with the number of refugees. It was not so much breaking the (Dublin regulation) law than a dictate by circumstance that they began to simply forward the refugees into Europe's center, including Germany, which had until then been conveniently shielded from any refugee inconvenience by the Dublin regulation. That regulation now had become unenforceable.
My impression of Angela Merkel is that she is smart and conscientious. Even though she is famous for being unspectacular in personal appearance and political action, she is able to take radical steps that are untypical for a conservative politician: Abolish the draft, abandon nuclear power, and, in 2015, accept the Syrian refugees. The last two were almost spontaneous decisions under the impression of extraordinary events: A nuclear disaster of the highest order in a country comparable to Germany, and a civil war targeting the civil population in a country where many people had enough money to pack and leave, not very far from Europe. And pack they did.
Like with nuclear power, Merkel made what was, in my opinion, an essentially moral decision. Something that should not be under any circumstances was in her power to prevent, and she did. She also assessed correctly that both decisions were possible, that their cost was manageable: More coal burning without nuclear power, and substantial but manageable civil, administrative and budgetary strains with the refugees. Totally doable. "Wir schaffen das."
Still: The influx of, at its peak, 200,000 refugees per month overwhelmed many communities which had their school gyms and community centers repurposed for many months and became temporary homes to hundreds or thousands of foreigners. (As a comparison: The U.S. took in 1845 Syrian refugees in three years, a number that arrived within eight hours in Germany during November 2015. It still was hotly contested.)
Merkel's decision caused an enormous backlash. There is a sizeable xenophobic faction in the population who are against any immigration from countries south of Norway, and of course poor Germans living at subsistence levels wondered why suddenly all the money was available to build shiny new homes and sustain a million people who never had done anything for the country, while they had been told for years that there was, sorry, simply no money to improve their situation.
This story is one main driver for the loss of trust in the political system in Germany by a significant faction of the populace that extends far beyond the classic anti-democratic radical right. Many rather mainstream citizens had the feeling that politicians don't listen to the people, tolerate violations of international treaties, break the law themselves and indeed betray their oath, and that they are in bed with regular media who are under the control of politically correct journalists who don't tell the truth, e.g. about immigrant crime, when it does not fit political correctness.
It became clear that the huge influx was politically and socially unsustainable in Germany. Conscience or not, Merkel had to do something. The main solution was to bribe Turkey into containing the influx. Additionally, the Balkan countries closed their land borders to prevent unimpeded transmigration. Both developments are morally deplorable. But most Germans, including many politicians and SE authors, don't complain about it with a certain silent, guilty relief.