Welcome to the Forum.
I would advise you to perform a soft reset (no data will be cancelled), enter *#7780# on your keypad, default code "12345".
After that, try to connect your headphone.
In this case, the best thing to do would be to visit your local Nokia care to get the phone checked.
In the same time, they will be able to reset your security code to the default code.