Why doesn't pin code/pattern work? I have a Samsung Galaxy Grand Prime and when I set a pin code it would show up, but it would switch back to swipe to unlock even though I have it secured as PIN. It just occasionally switches my screen lock to swipe and to PIN and I can't figure out how to make it stay as PIN.
Did you consider trying other screen lock screen apps from playstore?(If not please do!)

If this doesn't work then a factory reset might do the job.