Preheat the oven to 375º. Grab a large pot and fill halfway with water, bring to a boil. Meanwhile, trim and cut green beans in half if they are fresh. If frozen just set aside. Add the green beans to the boiling water and cook for 2-3 minutes, depending on how crunchy you like your green beans. (Keep in mind that the beans will cook more in the oven, so be sure to overcook). Use a strainer to drain the beans and run cold water over them to prevent overcooking.
Melt 1/2 tablespoon butter (or olive oil) in a large sauté pan over medium-high heat. Add the thinly sliced onion and sauté for 2-3 minutes, stirring occasionally, until the onion is partially cooked but still holds its shape, don't overcook the onion.
Transfer the onion to a bowl. Add another 1/2 tablespoon butter to the sauté pan, along with the panko, and stir to combine. Brown the panko for 2-3 minutes, stirring constantly, until the panko is lightly golden, be careful to not allow it to burn. Remove from heat, and transfer the panko to the bowl with the onions, mix well and add in 1 cup Parmesan (1/2 cup will go in the mushroom sauce below) , oregano, salt and pepper.
Wipe the sauté pan out with a paper towel. Melt another 1/2 tbsp butter over medium-high heat. Add the mushrooms and sauté for 5 minutes, stirring occasionally, until lightly browned and soft, you can add a tbsp of chicken broth to help steam them if needed. Add the garlic and sauté for 1-2 more minutes. Sprinkle the flour over the mushrooms and sauté for 1 more minute. Add in the chicken broth and stir until the flour is dissolved completely. Add the milk and and 1/2 cup of parmesan, stir to combine well. Let the mushroom mixture simmer for about 2-5 minutes until it's thickened. Add in the fresh thyme over the top. Add the blanched green beans to the mushroom cream sauce. Mix well and be sure the beans are evenly covered. Grab a 9x13 or similar sized baking dish. Pour the green bean mushroom mixture into the baking dish. Be sure they are laying flat and even. Next, add the onion, panko mixture over the green beans and lightly pat the mixture down. Pop into the oven for about 25 minutes. Keep an eye on it to ensure it doesn't burn. If using jalapeños, slice and top the casserole with them (trust me its a great addition if you like heat). Serve warm and enjoy!