This glitch occurs while fighting HeatMan, and you need to have Bubble Lead weapon (to make it easier). In one of HeatMan's attacks, he tosses three small flames at you. When he does this, use the Bubble Lead twice so that two bubbles are on the screen along with HeatMan's fire sparks. Before the Bubble Lead hits HeatMan, jump towards the gate you entered the room in and as you touch the gate, get hit by one of HeatMan's flames. If done correctly, the gate will open and and transport you to the beginning Wily Stage 1.
Wily Stage 1 will not have its normal color scheme, but it will have the color scheme and tileset of HeatMan's stage instead. Once you manage to get here, you will be mysteriously hit by something invisible until you die. However, you will start at the beginning of this stage, and you will no longer get hit.