Please note in SQL-1 that test_number = 'TEST4P20 ' has a space and in SQL-2 there is no space test_number = 'TEST4P20' has no space.
Is it not a bug?
Doubtful. You haven't provided actual data types here but it seems you are using character instead of text. Your desired behavior is provided by the text data type.