We were able to find the root cause.
In our case, we were using 3rd party library (using Cocoapods). We changed the Mach-O type for that pod (inside the Pods.xcodeproj) to Static Library and the code coverage started working. By default, it was a Dynamic Library.