Ok, I solved it in a different way. For anyone having the same problem in the future, I had to convert the polygon to a pad in the footprint editor. I did this by placing a new pad on it and pressing Crtl+E twice:
https://www.reddit.com/r/KiCad/comments/rrgvn6/v6_creating_pad_from_the_selected_shape/