Apparently, you have to pass some data through the layer to be able to get or set weights. I took the example from Keras (Conv2D layer 1) and got this result:
input_shape = (4, 28, 28, 3)

# Without passing data through the layer
l = tf.keras.layers.Conv2D(input_shape=input_shape[1:], filters=3, kernel_size=3, padding='same')
print(l.get_weights())  # Empty list

# After passing data through the layer
x = tf.random.normal(input_shape)
l = tf.keras.layers.Conv2D(input_shape=input_shape[1:], filters=3, kernel_size=3, padding='same')
y = l(x)
weights = l.get_weights()
print(weights)  # List containing 2 numpy arrays
print(weights[0].shape)
print(weights[1].shape)