Antique headboard and footbard with iron frame
It sounds like you have the rails swapped. Right on left and upside down. Try moving them to the opposite side and turned top to bottom I think you will find they fit that way and hold the slats in place.