So the battery level value is in accurate returns the battery percentage in multiple of 5 values e.g. battery percentage is 42 but the api returns it as 40. So please fix the issue if possible because i checked that the devices running iOS versions below 17 appear to be working fine.
This is an intentional change in iOS 17—see the release notes here: https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-17-release-notes
UIDevice.batteryLevel is rounded to the closest multiple of 0.05.