Hi @SergeiL,
Welcome to the Atlassian developer community!
I can confirm that the URL will change in the way you shared when adding a hash (#) to the callback URL.
I don’t think there is an option to fix the redirect URL if your goal is to preserve the hash, but you could consider to replace the callback URL with something different that doesn’t contain the hash like the following: http://localhost:4000/callback/atlassian
If you are using a framework, you might also need to add another endpoint (e.g. http://localhost:4000/api/v1/redirect-to-page) and there redirect to the URL with the hash and maintaining the code parameter added by the consent screen.