Problem/Motivation
To prevent a dependency on block entities in block templates/preprocessing, we made the id optional. However, it looks like the mentioned template file is still relying on, resulting in invalid and duplicate ID's in case you are using a menu block in a context where no ID is provided (e.g. with page_manager).
Proposed resolution
Not sure how to fix this, can we use the derivative plugin ID there somehwere? Might not be unique, though.
I once discussed with @timplunkett about being able to rely on a unique ID for blocks and make whoever is using block plugins responsible for setting one. i thought I opened an issue, but I had no luck at all at finding that again.