I recently bought an FZ300 and noticed some posts from owners re lens cap falling off when hiking / moving around.
I had found that sometimes the lens cap popped off but only when I had just put it on. I realised that the orientation of the spring tabs to the lens (up / down, left right, a few degrees this way or that way affected whether it would stay on.
So today I had a closer look. You will see that the embossed edges at the end of the tabs are actually threads, albeit not much. So they will screw in. Playing with it I found where I could consistently get it to stay, and if it felt loose as I placed it, just a clockwise twist of about 10 or 15 degrees would lock it in....