Heat oil in a large skillet over medium-high heat. Add mushrooms, pepper and salt; cook, without stirring, until the mushrooms are golden brown on one side, about 3 minutes. Stir and continue cooking until they’ve released most of their liquid, 2 to 3 minutes more. Add shallot and cook, stirring, until fragrant, about 1 minute. Reduce heat to medium. Add sherry and cook, stirring, until evaporated, about 1 minute. Sprinkle flour over the mushrooms and stir to coat. Add broth and bring to a boil, stirring. Cook, stirring, until thickened and reduced slightly, 5 to 7 minutes. Stir in thyme.