ValueError: x and y can be no greater than 2D, but have shapes (144,) and (144, 500, 144)

Strange. Either one works fine for me. What is the shape of your posterior_trend?