Jenkins agent config history missing and not updating for some nodes

Jenkins setup:
Jenkins version: 2.346.3
Job Configuration HistoryVersion 1176.v1b_4290db_41a_5
Jenkins is running inside a docker container
OS: Ubuntu 20.04

Issue: Unable to see agent config history for some nodes. The page just says “No agent configuration history available”

And seeing only one entry on some nodes, no matter what configuration gets updated and saved we see the same warning as below. No new config changes get logged in config history.

But on some nodes the config history is getting updated normally and able to see every config change.