Using two passports is not always the solution. As a dual citizen of two countries, I also have two passports. A couple of years ago I travelled to Malta with the passport from the country I currently live in. One week later I flew over to Israel, where I used the passport of my birth country. I was extensively interrogated at the border, because apparently the system flagged me to the border officer as there was no record of me entering Malta with the passport I attempted to leave the country with.
Interesting. But, TBH, it seems pretty obvious in the hindsight: it's a huge red flag that the travel history in the same passport is not self-consistent (as a result of using different passports for entering and leaving the same country).
I always wondered if this would get flagged somehow. I've never tried it myself, but I've thought about doing it.
What I was mentioning though is that countries will let you have a second passport from a single country if you have issues like this, to avoid showing the stamps in one passport.