grapheneos1
All of a sudden after many hours not using the phone it asked me for the pin instead of for the screen unlock pin (much longer one).
Could it be that you're mixing up screen lock and SIM lock?
Screen lock: Settings > Security and privacy > Device unlock > Screen lock
SIM lock: Settings > Security and privacy > More security and privacy > SIM lock
Finally it said wait 300 seconds
Getting a delay notification like this sounds more like the secure element's internal timer is stepping in after X failed attempts entering the wrong profile's lock method credentials.
If you've entered the wrong PIN for your SIM card more than three times, you should'nt get a delay notification; the SIM card should be locked instead:
If the wrong PIN is entered more than three times, the SIM card will become locked. It can be unlocked by entering the PUK code provided by the mobile service provider,[2] which may be available on the SIM card's packaging, the contract, or provided by customer service after identity verification.
source: https://en.wikipedia.org/wiki/Personal_unblocking_key
I introduced my pin and does not work, then the older pin and does not work
The old PIN doesn't work for either screen lock or SIM lock.