In my case the solution was to allow the "Local Network" permission in the iOS settings for my app.
When launching my app for the first time it asked for this permission (and never asks you again for future builds), but I hit "Don't Allow" since I didn't think I needed it. Obviously I do! 😅