Two voltage regulators on same heatsink
You need to insulate electrically one or both voltage regulators from the heatsink:-



If you don't then the resulting output will be 12V on both because a 5V regulator normally uses a series pass transistor to control voltage to its load and when presented with a load voltage higher than 5V it will shut that transistor down.

So, you have to insulate one regulator and probably it's best to choose to insulate the regulator that handles the smallest power dissipation, possibly the 12V device (based solely on least voltage drop across it).