>why is 'magus' pronounced with a hard 'g' and 'magi' with a soft 'g'?

There are other examples following the same rule:
Hard “G”
Gu: Gus; Angus; Gut; Gun
Ge: Get
Go: Got
Soft “G”
Gi: Gin; Magic; Tragic; Gibralter
Ge: Gentle; Gentile; Gentry; Agent; Agenda