Thanks for the pic.
Looks like the black connected to the switch is your line (since it’s coming from the bottom). Red looks like the load. The white bundle with the wire nut in the back of your box is neutral.
Now, please understand,I’m not an electrician and could totally be wrong, but I would wire it as I stated above and see if it works.