Multifractal formalism for inverse measures of random weak Gibbs measures