You could try using offset expressions. This will offset points in layer B with a random distance of +-300 m if there is a point in layer A within 10 m of it:
case
when overlay_nearest(layer:='A', limit:=1, max_distance:=10) then array(rand(-300,300), rand(-300,300)) else array(0, 0) end