Encountered on a vanilla server.
Steps to recreate:
Dye Shulker Boxes different colors, leaving one undyed, and have dyes of the same colors in your inventory.
Click the Recipe Book recipe.
The same color of Shulker Box will be put in the recipe, regardless of its slot in your inventory.
“Recipe Book” would be more accurate, as “Knowledge Book” also exists as a command-only item.