You can use any* compositing package to create clean plates out footage.
In terms of workflow, you need to start at the storyboard stage of a production, make sure you’ve got good angles to track, and if you haven’t you need to speak up so that the director knows that the shot will cost more (or just not happen at all). Once the location is confirmed you can go out and shoot some texture reference. Then on the day of the shoot get out and shoot some lighting reference (grey ball + shiny ball) and some reference frames for tracking in case you desperately need them. This will all go into making the final shot a bit easier to complete.
Personally there’s no way I would have chosen that shot to track because of the amount of stuff that’s in the way. It’s going to take a long time to track in all the patches you’ll need to create a reasonably believable patch of ground big enough to obscure the trees.
The first thing I would do after getting a rock solid track is create some proxy geometry and get that in the scene, over the top of the trees. Assuming that your track is good it’s then just a matter of texturing it effectively using reference from the scene you shot.
Honestly, I think that this might be a challenge too far because of the angle of the shot, the scale of the geometry you’ve inserted (it looks far, far too big compared to the scale of the old castle) and the fact that the track looks like it’s at the wrong angle. If you pull this off I would love to see the result!!
*as long as they support some sort of 3D space, examples would be Nuke, Fusion, AE, Blender