Good news, bad news.
This code creates a polygon based on your point geometry, currently 40 m wide and 20 m high (if using a m-based CRS)
make_polygon( make_line( make_point($x-20,$y-10),make_point($x+20,$y-10)),make_line( make_point($x+20,$y-10),make_point($x+20,$y+10)),make_line( make_point($x+20,$y+10),make_point($x-20,$y+10)),make_line( make_point($x-20,$y+10), make_point($x-20,$y-10)))
But since it is based on the CRS of the layer, it is slightly rotated.
Also, the rectangle is not filled. So I think you'd be better of with the "manual legend" approach.