Most of our praying is defence. We explain the situation, supply context, and quietly argue our own case before a God who was there for all of it.
David does the opposite. He asks to be searched. He invites the examination instead of managing it, and he does it without hedging or setting terms.
That is a strange request unless you already trust the one doing the searching. You do not hand somebody a lamp and point it at your own worst corner if you think they are looking for a reason to leave.
So the prayer is not really about sin. It is about safety. It assumes that whatever God turns up, He is not going to walk out over it, and that the finding is the first half of the healing.
Notice how it ends. Lead me in the way everlasting. He is not asking to be catalogued. He is asking to be taken somewhere.