Never had much trouble in separating the tire from the rim, and putting it back together, after having fixed the puncture. The same applies for fixing the tires of more recent MTBs, where upon following the usual technique no major obstacle arises in accomplishing these tasks.
But now, just after a bit over 100 Km into using my Xiaomi M365 scooter, I found a rattling noise in the front tire while riding it. Went on to take a look, and found a thumb tack, fully buried in the tire. As I started removing it, I could hear the air escaping. Decided to leave it there just so that I could ride the scooter back home.
Obviously the inner tube was punctured. The challenges started with the removal of the two nuts that secured the front wheel. These were incredibly tightened or otherwise held in place. Only after rounding one of the nuts with the most torque I could get my arms to deliver, I learned that these nuts had been secured with the help of red thread lock or similar substance. In order to remove the damaged nut, after many attempts, I haver resorted to a more brute force approach, and started to perform cuts in the nut, in order to remove it in pieces. Just before going further with the cutting, I decided to apply more WD40 and again try to undo it with the round part of the 18 mm wrench (which didn't yet started slipping in spite of the nut being somewhat rounded). Just as I was giving up on the force I was applying, the nut started moving (it seemed like a bit of a miracle), and was able to extract it.
Performed the same procedure with the other nut (not forgetting to bath it with plenty of WD40), and it also came off after some torque (while at the same time being careful not to let to tool slip). Was able to extract the second nut and this one came out intact.
That was challenge #1.
The removal of the tire was relatively easy. With the help of the plastic tools that were part of a bicycle repair kit I had, I was able to separate if from the rim. The inner tube valve would not separate from rim, as there was not enough room for the valve to come off at the required angle. I could not find any other way but to open the motor (rim) cover in order to remove the plastic part that prevented the valve from bending sufficiently to separate from the rim.
Finally with the inner tube removed, and after confirming that it was indeed punctured, and that no damage to the inner wall of the tire existed, I placed the new inner tube (my Xiaomi was supplied with an extra pair of tires and inner tubes) and started trying to put the tire back in place. That was the third hard challenge, and where my bicycle tire repair experience started to prove useless.
After several attempts at closing the tire (the rims seemed too wide for the tire) without success, I (almost desperately) decided to try to use a small vise to deform the tire, with the expectation of making it easier to put it back into the rim.
And to my surprise the technique worked, and without major effort (only with the help of the plastic tools) the tire was successfully put back in place.
I was quite happy with the accomplishment, but as usual, the happiness needed to be offset with some bittersweetness: with so many attempts, the friction of the new inner tube with the rim edges and possibly the tools, caused a puncture to it. I realized after inflating the tire, that it would quickly deflate. As such, I went on and repeated the whole procedure (I still had one spare inner tube left). This time it was quicker because I went straight to the working approach.
By the way, the Xiaomi manual makes the procedure look like a walk in the park:
#4 challenge - obtain the new nut: I knew that online these could be purchased from a variety of different sites, but I wanted to be able to assemble the scooter right away. So I tried to look in local stores for one that would possibly have the nut. After trying a bicycle shop, they gave me the reference of a hardware store. There I was able to find a close enough nut: it had the same thread diameter and pitch, but lacked the flange.
The original Xiaomi nut is flanged and has a M12 1.25 pitch thread. The nut outer diameter is 18 mm.
The nut I obtained from the hardware store has the same thread but the outer diameter is 19 mm.
I tried it anyway, by adding a washer instead, and tightened it with a decent amount of torque.
So far its going pretty solid. Even though the motor exerts some torque, I believe that it should be ok without the thread lock - a inner washer, the shape of the motor shaft and receptacle in the frame prevents its rotation/slipping.
For those curious about the hub motor inner workings: