The bug was introduced in 014e25b6030a05adf9622694539b92a38f71a2b1 when removing what was thought to be unused code paths. Unfortunately, we didn't have a test that covered the particular case where this code path was used.
This commit adds a test and fixes the bug.
Coverage: 98.865% (+0.0009%) from 98.864% when pulling f950f0a0e2aab0123577b261212ed9b8b5073bad on bugfix-2023-05-11 into fb77b0977c5cd4cc49293c5d78876b651526bb56 on master.
The bug was introduced in 014e25b6030a05adf9622694539b92a38f71a2b1 when removing what was thought to be unused code paths. Unfortunately, we didn't have a test that covered the particular case where this code path was used. This commit adds a test and fixes the bug.