Commit a1b8df71a199c591b3b2c2b40f50cdc712c9d has a typo "rpcusername", which would likely cause the syncing node to fall back to cookie auth.
It seems easier to me to just call bitcoin-cli -datadir=${workdir}/bitcoin/data -rpcport=9004 instead of specifying the rpcuser and pass. Note that they are also identical for the syncing and synced peer, which might lead to issues.
Commit a1b8df71a199c591b3b2c2b40f50cdc712c9d has a typo "rpcusername", which would likely cause the syncing node to fall back to cookie auth.
It seems easier to me to just call
bitcoin-cli -datadir=${workdir}/bitcoin/data -rpcport=9004
instead of specifying the rpcuser and pass. Note that they are also identical for the syncing and synced peer, which might lead to issues.