I’m glad you liked the article. I’m wondering if the reason why the output doesn’t match the cached plan is because the plan contains information about all paths of execution. If the parameter you pass results in only a few paths being executed, then the results will not match ALL of the cached plan.
You can discover a lot more about DMVs in my forthcoming book: SQL Server DMVs in Action www.manning.com/stirk which contains 100+ scripts like this one.
Chapter 1 can be downloaded for free and includes scripts for:
A simple monitor
Finding your slowest queries
Find your missing indexes
Identifying what SQL is running now
Quickly find a cached plan