Hi,
The higher the price of a product, the better the quality is. Fine.
The higher the price of a product, the quality is not necessarily the better. No. As you can see, the second part of your second sentence does not follow the same pattern as in your first example. Say something lke this.
A higher price does not necessarily mean better quality.
Best wishes, Clive