Preheat the oven to 350 degrees F.
Cut the green beans in half if you like the pieces to be a little smaller. Blanch the green beans: drop them into lightly salted boiling water and allow the green beans to cook for 3 to 4 minutes. Remove them from the boiling water with a slotted spoon and immediately plunge into a bowl of ice cold water to stop the cooking process. Drain the beans once they're cool and set aside.
Add the bacon pieces to a skillet over medium heat. Cook the bacon for 2 minutes, and then add the peppers, garlic and onions, and continue cooking until the bacon is done (but not crisp) and the onions are golden brown, 3 to 5 minutes. Remove from the heat and set aside.
In a separate saucepan, melt the butter over medium heat. Sprinkle the flour into the pan and whisk immediately to evenly mix it into the butter. Cook for a minute or 2, and then pour in the milk and half-and-half. Continue cooking, whisking constantly, while the sauce thickens, about 2 minutes. Add 1 1/2 teaspoons salt, some black pepper and the cayenne, and then add the grated cheese. Stir while the cheese melts. Turn off the heat.
Add the bacon/onion mixture and stir to combine. Add the green beans and stir gently to combine. Pour into a baking dish and top with the panko. Bake until the sauce is bubbly and the panko is golden, about 30 minutes.