I am trying to use otServerGetNextLeaderService but it always returns OT_ERROR_NOT_FOUND.
I added a service on one node using otServerAddService and registered the local network data with the Leader using otServerRegister. Then I tried to call otServerGetNextLeaderService but it returned OT_ERROR_NOT_FOUND.
How can I get OT_ERROR_NONE when calling otServerGetNextLeaderService ?
It's not year clear what the issue may be.
Have you tried using the OpenThread CLI to test? The following CLI commands may be helpful for testing: