I also do both.
Many times I'm looking for new things, ingredients, flavors, inspirations. I'lll search for a recipe ( or sometimes one just kinda falls on my lap). I almost always make it the first time following it exactly. If it comes out perfect, II won change a thing and follow it pretty exactly in the future. If I feel the recipe is good, but not exactly what I want, and I can make changes to personalize it to my liking ( adding / subtracting ingredients, messing with the amounts...), I will make those changes ( writing them down) until it is exactly what I'm looking for. And then, with the new enhanced recipe ( with my changes(, I will then follow the recipe exactly again, since I already did all the legwork to improve it.
Also, my memory isn't what it once was, so even a recipe II may have made a bunch of times, I made know it 90% by heart, but still have to refer back to the actual recipe itself.
During garden season, I often have an unpredictable variety and amount of veggies I need to use pretty much at that moment, so I will experiment with them in different dishes that will vary depending on what I have on hand.
Things like certain vegetable soups, pasta sauces , stir fries ... are similar but almost never the same. I just kinda make things up as I go along with a good idea of the direction Im going, but never %100 sure what ill exactly come up with.
Whats good is after so many years of trial and error, I ( like most of us) have the ability ( usually) to walk into the kitchen and create. Trust me, I've had my share of failures, most still edible , but a few wound up I the trash, compost or back in the day, fed to the chickens. Some times my throw together meals are better than the ones I've had planned out.