Castilliano |
Only if your opponent has a Reaction that you trigger, typically an Attack of Opportunity. Warrior monsters (like Hobgoblins) and boss monsters (like Dragons) typically have these or a similar ability. Most monsters don't and you're fine.
Also, if your weapon has the Volley trait (i.e. longbows), then you're getting the -2 from being too close.
So you're much safer than in previous editions. There is a Fighter Stance at level 8 that denies even those Reactions and which enables your AoOs (if you have them) with a ranged weapon. Rangers have Skirmish Strike at Level 6 which lets you Step out of proximity and Strike in the same action.