Fixed-time Distributed Optimization: Consistent Discretization, Time-Varying Topology and Non-Convex Functions