Trying to switch between 12V and 5V, CD4066B analog switch
You're burning it up, because with VSS connectted to 5V  ground is outside the alloable range for an input or outputs. (they must all be between VSS and VDD

there's probably a better way to do whatever it is you are trying to do.
but I have no way to guess what that might be.







simulate this circuit &ndash; Schematic created using CircuitLab

that has the same 120 ohm impedance as the CD4066B switches, but later in comments you say that you 
need to power a device with the output, in this case
an adjustable regulator may be a better choice.







simulate this circuit