Fix NRE in `BaselineGenerator` (#26149)
Fix NRE in `BaselineGenerator` (#26149)

- follow-up to e1df92311662 aka #26027
- also correct an `Exception`'s `Message` to include variable values
aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore,aspnet/AspNetCore