Honestly, that might be true for some attorneys/judges or for juniors who have worked for that partner, but its certainly not universal and there are many star corporate partners who would advise the opposite. These are some of the contrary views I've heard expressed by corporate partners - with the caveat that I'm still pro-clerking for other reasons like what Klingsberg discusses.
First, if you've ever worked for a federal judge you'd quickly find that the work has absolutely zero overlap to the drafting/due diligence or conferencing work you do as a junior associate in m&a. Sure, it helps to know substantive corporate law, but only in the Court of Chancery would a clerk know they would be writing orders on those topics. More likely at somewhere like SDNY you'll be swamped with FLSA/IDEA/maritime/criminal motion practice as a federal clerk.
Second, there's an embedded loss in corporate practice at a large firm for taking a year or two to clerk and not be gaining skills crucial for a midlevel and senior associate: not just the mechanics of the deal and learning how to perform diligence and put together documents, but softer skills like management, team-building, making contact with key partners. To take CLS as an example, the overwhelming majority of students clerk one or two years out, not right after graduating (since most NY judges require work experience). This means you're leaving as a second or third year, and coming back as a third/fourth year who should be running a deal with a junior in a lean staffing model but now can't because you have non-applicable training.
Of course there are intellectual/career benefits to clerking that may outweigh what I've said above and it certainly shouldn't be discouraged...and for lit, ignore all the above. but I can't shake how this attitude sounds most in accumulating bells & whistles as we're all trained to do rather than making strategic moves for your chosen practice.