This isn’t a software bug.
Get the pod(s) that do this replaced, I did and now they’re always accurate.
My first AirPods Pro were both always bang on regarding charge level, my dog chewed a right hand side one recently for which I paid £25 to Apple for my first applecare incident, it had this random battery level thing, and even at some points made the chime sound that indicates low battery level even though i knew if I put them in the case then took them out this pod would behave again for a little while, before resuming weird random battery levels.
I had apple replace this new pod with another with a simple £85 hold on the visa card and lo and behold the replacement pod is also now bang on regarding charge level.