Submodule pull fails when running deploying automatically

site-name: cosmic-lokum-7cea48

When the deploy runs automatically after a git commit, pulling a submodule fails. When I run it again from the netlify web interface, everything works as expected.
This has been happening for about a month, previously everything worked. Neither the configuration on netlify nor the way the submodule is placed in the repository has changed.

From github.com:********
   ******....*******  main       -> origin/main
fatal: remote error: upload-pack: not our ref *******************
Errors during submodule fetch:
	<submodule_name>
: exit status 1

Hi there,

This is something you’ll need to fix - it happens based on your commit history. We’ve seen it happen to a handful of customers, and unfortunately for you, all of them fixed it without being sure what they fixed. But it was something in their git history.

The link I shared with all of them - which some reported to be moderately helpful (some never answered but did fix their build after I sent it; others gave up), is this:

Let me know if you manage to get it sorted out!