Peel the onions and cut them into slices, except for 1. Preheat oven (electric cooker: 200 °C/circulating air: 175 °C/gas: see manufacturer).
Grate cheese. Heat 2 tablespoons of butter in a saucepan. Briefly sauté the flour in it. Deglaze with 200 ml water and milk, bring to the boil while stirring. Stir in stock, simmer for about 5 minutes. Melt cheese in the sauce, season with salt and pepper.
Mix the sauce and onion slices and fill into four small or one large casserole dish. Bake in a hot oven for about 1 hour.
Crush the peppercorns in the mortar. Pass through a fine sieve to remove the fine "pepper flour" - it would burn quickly when roasted and the steak would taste bitter.
Dab steaks dry, season with salt and coarse crushed pepper. Press the pepper slightly. Heat the oil in a pan. Fry the steaks in it on medium heat for 3-4 minutes on each side. Remove from the pan, wrap in aluminium foil and leave to rest.
Finely dice the remaining onion and sauté in hot frying fat until translucent. Deglaze with cognac. Stir in 2-3 tablespoons of butter in small flakes with a whisk until the sauce thickens slightly - do not boil any more! Season sauce with salt and pepper.
Arrange steaks with sauce and gratins.