Further to my overheating suggestion above …
I had similar issues last summer with my KP, using it for video over wi-fi using ImageSync. Every so often the link would "break" for no apparent reason.
I went on to use WifiCommander
Wifi Commander for Pentax - wireless remote control for your Pentax camera , which gives a far more comprehensive feedback from the camera, and it reported that my camera was indeed overheating, even though the ambient temperature was well within the manufacturer's specifications.
Whilst not a solution to the problem of transferring photo's to a 'phone, if you have access to a Windows pc with wifi it may help as a diagnostic tool.
Another possibility is wifi interference.
I found my ImageSync range to be far less from my 'phone than that achieved by my laptop using WifiCommander, especially in a domestic environment … suggesting "other factors" to be involved