This used to happen on my K20D -- it sounds just like what you are experiencing:
https://www.pentaxforums.com/forums/pentax-dslr-discussion/34486-k20d-occasio...-captures.html
When it happened, it was always, ALWAYS the first shot taken after a power-up. And on subsequent shots it was fine.
The problem seemed worse when using some cheap knockoff batteries, but it was intermittent enough that it was really hard to pin down the exact conditions. It did not seem to be temperature related, or lens related, or shutter speed related, or anything like that. It happened with both new autofocus lenses and old Takumars.
I lived with the problem for more than two years, since it was usually pretty infrequent. When my service plan was about to expire, I sent the camera in for repair, and it was (seemingly) pretty well repaired, as far as I could tell. My return slip indicated they did repair the shutter mechanism, but I have no idea what they did, specifically. (It was under a service plan, at no cost to me, fortunately.)
I don't have that camera any more.