Factories are undergoing a digital transformation towards more cost-efficient, zero-defect manufacturing. The digitalized factories require communication networks capable of satisfying their strict latency and reliability demands. 5G and beyond networks are being designed to efficiently support services demanding Ultra-Reliable and Low Latency Communications (URLLC). At the MAC level, the use of dynamic scheduling for uplink transmissions entails a non-negligible latency introduced by the signaling messages exchanged to request and inform about the radio resources allocated for each packet transmission. To reduce the transmission latency, 5G defines Configured Grant (CG) for UL transmissions that pre-allocates radio resources to the User Equipments (UEs) and eliminates the need for requesting resources for each transmission. In this context, the availability of 5G NR simulation tools that accurately implement all 5G NR functionalities, and in particular, the technological enablers introduced in 5G NR to support URLLC, is key to analyze the capability of 5G and beyond networks to support time-critical services and research on new solutions. The availability and access to such tools are limited, and to the best of the authors' knowledge, there are currently no open-source 5G NR simulators that implement configured grant in 5G NR. To overcome this issue, this work presents the first implementation of configured grant in an open-source 5G NR simulator. In particular, configured grant has been implemented in the ns-3 5G-LENA system-level simulator, and it is publicly available. To accurately model the flexibility of 5G NR, we have also improved the implementation of Orthogonal Frequency Division Multiple Access (OFDMA) access mode in 5G-LENA according to 5G NR. To validate the implementation of CG and analyze the capability of 5G NR to support time-critical services, we analyze the latency performance that can be achieved using CG with different scheduling policies in Industry 4.0 scenarios. The results show that the latency values achieved with CG in 5G-LENA match with those reported by previous analytical studies. In addition, this study shows the importance of efficiently using radio resources to reduce the latency experienced and meet the requirements of critical services.