Currently, there is no way to swap to a melee weapon before ending your turn for an AoO; the only exception is using and cancelling a weapon skill or bonus action that uses a melee weapon--if you don't have any bonus actions left for that turn, though, you're screwed.

PLEASE add a button or action for the radial menu for swapping weapons on PS5 (and apparently it's an issue for PC players using controllers as well).