Ahh, looks like it was for an "architrave switch" You could possibly fill it with a two part resin filler and sand/cut it to match, or replace the whole piece (although looking at the architrave, you might struggle to find a moulding the same) It would be very expensive to get a few lengths made up to the same profile.
Looks like standard architrave, [the two doorways butt together so you have a piece out of each side] . You could remove one door set and use to repair the other then fit new to one door only.
Use a sharp chisel to square up the hole, cut a piece of timber of appropriate thickness slightly oversize and undercut to slightly undersize(in other words, taper the edges) apply decent wood glue and tap in tight. Leave till the glue is set then plane flush. You will need a rebate plane to get into the corners and this can also be used to run the grooves.
If you need to find a tradesperson to get your job done, please try our local search below,
or if you are doing it yourself you can find suppliers local to you.
Select the supplier or trade you require, enter your location to begin your search.
Please select a service and enter a location to continue...
Are you a trade or supplier? You can create your listing free at DIYnot Local