np.random.uniform() does not work with complex numbers, only reals (i.e. floats). However, as long as you only want real numbers along the main diagonal, you can freely assign floats to a complex matrix and they will automatically be converted with the imaginary part being zero:
H = np.zeros((9,9), dtype=np.complex)
rf = np.random.uniform(-1/3, 1/3, 9)
np.fill_diagonal(H, rf)
If you do want an imaginary part as well, you can create two sets of random numbers and then add them together (as the real and imaginary numbers lay on orthogonal axes, they won't "interfere" with eachother
H = np.zeros((9,9), dtype=np.complex)
rf = np.random.uniform(-1/3, 1/3, 9) + 1j*np.random.uniform(-1/3, 1/3, 9)
np.fill_diagonal(H, rf)
As a side not, also look at how you do not need to create your all zeros matrix as a one-dimensional structure and then reshape it. np.zeros() accepts multiple dimensions if it is passed a tuple rather than a number.