I found out what the reason was. Some applications do not support smooth scrolling and the 2 finger scrolling works according to the configuration set for the mouse.( multiple lines or screen scroll). note that this property is under mouse setting not touchpad setting. Regarding PyCharm, it does support smooth scrolling. But in order to make it work properly, Animated smooth scrolling should be disabled. Open PyCharm, Press Ctrl, Shift and A, Search for Smooth Scroll Options, Click on Type Smooth Scroll Options, Uncheck Animated smooth scrolling, Press OK.
Recently I got a Dell Precision 5570 laptop. The two finger scroll of the touchpad does not always work properly.  Although it it is smooth when is used in the browsers such as edge, in some applications like PyCharm, it is jittery and there are jumping effects when scrolling. This shouldn't be a problem with PyCharm as there was not two finger scrolling problem when this was tested on another computer with windows 11. OS: Windows 11 Laptop Model: Dell Precision 5570 Application: PyCharm 2022.3
Dell Precision 5570 touchpad - unsmooth two-finger scroll