In Peru there was a similar situation on 2022 when president Castillo tried to dissolve the Congress but the military did not support him , they were supporting the right winger Fujimori and the USA.
Before president Castillo Peru had 5 presidents in 7 years and many workers protests
Castillo had the support of the government of Bolivia, and Venezuela, and he wanted to implement the principles of Mariategui ( El Amauta ) which was a ‘Marxist” that wanted to apply Marxism to the peasants struggles and the indigenous peoples. He considered them to be the real proletarians.
The situations was different to South Korea because peasants supported him and they protested against his removal from the presidency and encarcelation
https://en.wikipedia.org/wiki/José_Carlos_Mariátegui