A traceroute just checks latency from you to the endpoint you are tracing to in terms of how many hops you are going through to get to the thing on the other side.
DNS just resolves a name to an IP and those are system things that any application or program asks the system it's running on for.
The reason you differences is how the DNS server you are pointing to answers your request as many do geographically responses based on where you are and give you different answers back based on your location. Some even filter out stuff for you and a myriad of other things.
More hops to something tend to equal more latency as you are have more devices to go through to get to there and it's one factor in determining how good or bad a route is. You as an end user cannot change how you get to something as your ISP does that. If you have a bad hop or a congested hop, things are going to be bad for you and you cannot change it other than complaining to the ISP or changing ISPs or using a VPN to take a different route (this has it's own capacity issues).
The challenge when offering blanket advice is that for me, your advise would not apply because both Google and CloudFlare resolve back to the same endpoint so there would be zero difference for me.
Others would find benefits as they may have better peering with Cloudflare or better peering with Google as it's all about testing.
I've probably spent far too much of my time / career troubleshooting network issues so it's something I have a passion for and enjoy.