Hope you’re well and thanks for the question - welcome to the Buildkite Support Community!
The good news is that this has been something we have seen before with received Bitbucket webhooks containing a short SHA which Buildkite resolves to BUILDKITE_COMMIT and hence those seen checkout errors occur. In that in agent versionv3.58.0 and newer - we included a fix for events like this (where BUILDKITE_COMMIT is set to a short SHA from a resultant webhook and errors are seen in the fetching process). The actual PR for the fix was described here. If you’re using an older version of the Buildkite agent than this, I’d suggest updating it to that version (or latest) to get this inclusive!
Another way that I’ve coined (transparently from the inbuilt agent resolution and from the commentary previously) is something like the below: you could potentially set the BUILDKITE_COMMIT with a git log to get the full SHA back, or potentially query the BitBucket API to list the commits and obtain the relevant full SHA from the responses’ payload (note you’ll need to export below in hooks - before the checkout phase)