I duplicated a layer ("Buildings") in QGIS 3.4.4 and with the Query Builder under Source I selected to just display schools. Subsequently I renamed this layer "Schools" by rightclicking on the layer, choosing Rename Layer.

The new name of the layer appears but once I tick the box to toggle visibility it jumps back to its previous name ("Buildings"). I'm also unable to rename the layer under Source (the 'displayed as' field is greyed out), see screenshot below.

How can I rename this layer permanently?

Edit 21-02-2019: I found that in other projects the layer could be simply renamed or saved with a different name just as was suggested in the answers below. I have not been able to do it with the project I had worked on and suspect a bug of some sort with the imported layers.

This question appears to be off-topic. The users who voted to close gave this specific reason:

"This problem cannot or can no longer be reproduced. Changes to the system or to the asker's circumstances may have rendered the question obsolete, or the question does not include a procedure to enable potential answerers to reproduce the same symptoms. Such questions are off-topic as they are unlikely to help future readers, but editing them to include more details can lead to re-opening." – underdark

2 Answers
2

Use the Select by expression on the original layer (Building layer) to select the schools and then right-click the building layer -> Export -> Save Selected Features As and give the new feature a new name, Schools for example. The new schools layer will added to the canvas with only school features inside.