You simply fly domestic from CM to Bangkok, so you're free to roam when you get to Bangkok. BTW, you don't go through customs leaving Thailand, only entering.
Once you've cleared immigration you're "sterile" so to speak so cannot leave the "system" so have to stay in transit in Bangkok. If you want to leave the airport at Bangkok, the first leg of the journey remains domestic so you don't clear immigration until Bangkok. So what has happened in the past to you is correct