In a food processor, pulse the fresh mushrooms until roughly chopped.
Transfer them to a large bowl, sprinkle with salt, and mix to combine.
Cover with a cloth and let sit at room temperature for 24 hours, stirring occasionally (the mushrooms will darken significantly).
About an hour before the 24-hour marination is complete, place the dried mushrooms in a medium bowl.
Cover with 2 cups (480 ml) of boiling water, using a small plate to keep them submerged.
Let them soak until soft, about 1 hour.
Transfer the marinated fresh mushrooms and all their liquid to the food processor. Use a slotted spoon to add the rehydrated dried mushrooms. Carefully pour in 1/2 cup (480 ml) of the mushroom soaking liquid, leaving any grit behind.
Add the vinegar, shallot, garlic, and a generous amount of black pepper.
Blend until completely smooth.
Pour the mushroom purée into a pot over medium-high heat.
Bring to a boil, then reduce the heat to maintain a gentle simmer.
Cook, stirring occasionally, for about 1 hour, or until the mixture is thick and homogenous. To test for doneness, place a small spoonful on a plate; if no liquid seeps out after a minute, it's ready.
Let the mixture cool until it's safe to handle.
Transfer it to a high-speed blender and blend until the texture is exceptionally smooth and velvety.
Stir in the sherry, if using, and adjust seasoning with more salt or pepper if needed.
Allow the ketchup to cool completely to room temperature.
Serve immediately or transfer to a sealed container and refrigerate for up to 2 weeks.
Don't rush the 24-hour marination. This step is essential for drawing out the mushroom liquor, which forms the deeply flavorful base of the ketchup.