I had the same problem - Samsung S5, changed the PIN but forgot it. Google didn't work, neither did Samsung.
As I didn't want to lose all the data on the phone and after a lot of head scratching here is how I solved the problem.
1. Downloaded "apowersoft phone manager" and "mobigenie3" - both are easily found in a google search. I didn't need both as they do the same job but I was being extra cautious.
2. After installing the programs, I started with "apowersoft". I connected my phone via a USB cable and lo and behold I had full access to everything on the phone even thought it was still locked.
3. I used the Backup option in the program and backed up Contacts, Text Messages, Call Logs, Music, Pictures, Videos and Apps.
4. I then carefully used the built in file manager to copy any other data files I might need - the one in particular I needed to copy was my encrypted file containing all my passwords for websites etc. I wasn't too worried about any other files so I stopped looking at that point.
5. I then used "mobigenie3" and did exactly the same again but saved the backups to a different location. I admit I was paranoid but the thought of losing all the data on my phone was terrifying.
6. I then disconnected the USB cable and, with fingers, legs and eyes crossed, I did a factory reset.
7. After restart I set up the usual items - including a PIN which I wrote down this time, connected the phone again via USB, and restored the data using the programs mentioned above.
I am now a happy bunny.
DISCLAIMER: although this worked for me, I cannot guarantee it will work for you so please go slowly and think carefully before you do a factory reset.