Can I use a heavy gauge extension cord from the wall to a UPS?
It's a heavy load like an air conditioner, so use an air conditioner extension cord.  

Manufacturers can be greedy/cheap about sizing extension cords, using the absolute minimum UL requires for safety.  Bumping to the next size could cost them 25 cents a unit wholesale, which on 100,000 units, is real money. 

Using a same-gauge extension cord is not a good idea, then you would be substituting 6 feet of 16AWG for 12 feet of 16AWG, and that is worse.