Based on your description in the post above, it does sound like the water lines are reversed. I've seen it happen before.
The following advice applies if you are in Chicago city limits. If you are in a suburb, rules might be different.
First, I would keep the existing tank. It's from 2017 so it should have many years left on its service life. Chicago water is not super rough on water heaters unlike other locations.
You most likely do not need an expansion tank -- most houses in Chicago do not have them. The only cases where you might need one is if you have a fire sprinkler system, backflow preventer valve, and/or pressure reducing valve. These are not common in Chicago though.
The gas pipe definitely needs to be hard piped (black pipe) instead of flex. Make sure that the new black pipe that is installed has a drip leg and a union in a logical location in case you need to remove the tank later.
When you are doing the work, I would have the plumber remove the plastic drain valve at the bottom of the tank and install a brass drain valve (something like https://www.supplyhouse.com/AO-Smith-100263912-3-Brass-Ball-Valve-Drain-Kit
). This makes it way easier and safer to flush sediment out of the tank.
Humidifiers usually are piped to the hot water side.
For the water piping on the top of the tank, you need the shutoff valve to stay on the cold water side. Right now you have two dielectric unions that connect to the top of the tank nipples. These tend to rust/clog up over time, so if you want to make it even better you can use brass unions and a 7" brass nipple connected to the copper lines.
For extra peace of mind, you can remove and replace the anode rod on the tank while you're doing all of this work. Probably not necessary after 5 years in Chicago water, but if you don't want to worry about it for another 10+ years you can swap the rod at the same time.
Hope this helps.