This happens because the Firmware Upgrade page in Meraki Dashboard shows the status for all product families supported by the organization, not just the devices currently in your inventory.
In this case, it's not possible to display only the firmware status of the devices you have in your organization.
You can adjust your API logic and create a list for only the MX record, ignoring device families that are not in your inventory.
I am not a Cisco Meraki employee. My suggestions are based on documentation of Meraki best practices and day-to-day experience.
Please, if this post was useful, leave your kudos and mark it as solved.