Creating filters using the "frequency sampling" approach, meaning deriving the impulse response from the inverse FFT of a desired frequency response as suggested by the OP is not recommended over alternate approaches such as least squares outlined above, and firls in MATLAB, Octave and Python, and windowing approaches to filter design. This is because the inverse FFT suffers from time domain aliasing, requiring additional zero-padding which results is a much longer filter to achieve the same performance that the other approaches listed would provide. This is demonstrated in this linkdsp.SE #31905. The frequency sampling approach to filter design results in frequency response that has an exact match at the frequency samples chosen, but greater error everywhere else compared to the other approaches given the same complexity (number of coefficients). To mention however, the case where "frequency sampling" design excels is OFDM (orthogonal frequency division multiplexing) since in that case we are only interested in discrete frequencies.