Nice work on the plugin. For anyone who still needs to find which existing topics lost the header, it’s checkable from outside — no rails, no database:
curl -s https://EXAMPLE.COM/sitemap_1.xml \
| grep -o 'https://[^<]*/t/[^<]*' \
| while read -r u; do
curl -sI "$u" | grep -qi 'x-robots-tag: *noindex' || echo "$u"
done > missing-noindex.txt
sitemap.xml is usually an index pointing at child sitemaps, so expand those first and run this per child. Add a sleep if your site rate-limits.
One thing worth separating for anyone finding this later: the header and the canonical are two independent signals and they fail independently — a topic can lose the X-Robots-Tag and keep a correct canonical, or the reverse. Check both:
curl -sI URL | grep -i x-robots
curl -s URL | grep -i 'rel="canonical"'