Would be helpful to get hold of the composition of nationalities in Yunnan to see if lemon's theory holds true.
My limited understanding of the Myanmar situation is that Rohingya Muslims mostly fled Myanmar's ethnic cleansing in '17 to Bangladesh. During the crisis, China mostly acted as mediator advocating repatriation. Did (and would) China officially grant a safe haven in Yunnan for these Rohingya Muslims? My assumption is had these war refugees crossed into the Chinese side, for example to Ruili, the border crossing would've likely been illegal in nature, thus their foreign residency may have been off the books.
As for the more recent army coup. Rumors were Myanmar’s pro-democracy movement actually blamed China of conspiring with the military junta. Chinese factories in Myanmar's biggest city Yangon were attacked for this reason. If hearsay were true, would the Chinese government counterintuintively harbor these pro-democracy civilians with visa? This is assuming pro-military coup civilians would contently stay put in Myanmar.