Tracing the magnetic topology of coronal mass ejection events by Ulysses/HI-SCALE energetic particle observations in and out of the ecliptic