After getting contact with Salesforce Support they answered that this can occur and that it also is 'working as designed', even though it is indeed a grey area, with no documentation that covers this detail.
Below you can check the answer from the support.
The issue was strange even for us and it turned out to be working as
designed after consulting with our R&D Team. when you refresh the
sandbox the client Id and Client secret gets changed and you will be
still able to use old values which should not be in actual.
While we specified this as working as designed we will continue to
learn about how our customers are using the product and make
adjustments for future releases. We understood that this scenario is
grey area which is not fully documented.Our product has created a User
story(feature request) in order to remove the old values from the
backend.This might get implemented in the upcoming releases
I hope you understand.Let me know if you need any further assistance
from my end
Thanks and regards,