This old code is still in the createImage handler
# TODO: hack to make this work for now, need to refactor br = BuildRoot(self.session, self.options, build_tag, self.arch, self.id, repo_id=self.repo_info['id']) br.markExternalRPMs(imgdata['rpmlist'])
The image build doesn't use a mock buildroot, it just instantiates this class so it can use the markExternalRPMs method. This results in an empty buildroot entry linked to the task and triggered issue #4231
This issue has been migrated to Fedora Forge: https://forge.fedoraproject.org/koji/koji/issues/4233
Please continue any further discussion there.