Fry sliced onions in oil over high heat until charred, working in batches.
Add bay leaves, vinegar, Worcestershire sauce, garlic, and sugar to the pan with onions.
Simmer the mixture for 20-25 minutes until onions are soft.
Remove bay leaves, stir in chopped anchovies, and let cool slightly.
Blend the mixture into a smooth purée, adding water if necessary.
Strain through a fine-mesh sieve and chill the ketchup.
Preheat the oven to 200°C.
Mix butter with paprika, sage, chilli flakes, pepper, salt, and garlic powder.
Coat the corn in the spiced butter and wrap each head in foil.
Roast on a tray for 20-25 minutes until the kernels are cooked.
Unwrap the corn and serve with the burnt-onion ketchup.