I've been hitting this error as well, so did some testing.
It looks like this is being caused by a bug that has already been fixed in Next.js - it seems to have been introduced in 15.1.0, and it is fixed in the 15.2.0 canary releases.
Downgrading Next.js to 15.0.4 fixed the issue for me.