Thank you again! That was good to point out. I went through and added the equal to operators, but the legend sadly didn't change. I wonder if there's a more simple fix that I'm just missing. And thank you for pointing out how to include code! I'll do that here.
New code:
var temp = $feature.temp;
When(temp>17 && temp<=17.5, 17.0, temp>17.5 && temp<=18, 17.5, temp>18 && temp<=18.5, 18.0, temp>18.5 && temp<=19, 18.5, temp>19 && temp<=19.5, 19.0, temp>19.5 && temp<=20, 19.5, temp>20 && temp<=20.5, 20.0, temp>20.5 && temp<=21, 20.5, temp>21 && temp<=21.5, 21.0, temp>21.5 && temp<=22, 21.5, temp>22 && temp<=22.5, 22.0, temp>22.5 && temp<=23, 22.5, temp>23 && temp<=23.5, 23.0, temp>23.5 && temp<=24, 23.5, 24);
New legend (still looks the same where the middle is not separated):