When sorting Library grid view by capture time, LR doesn't sort correctly by fractional seconds -- it ignores leading zeros in the EXIF:SubSecTimeOriginal field. To reproduce:
1. Take three photos directly from a camera: a.jpg, b.jpg, c.jpg.
2. Set the DateTimeOriginal and SubSecTimeOriginal field of the three photos using these commands:
$ exiftool -datetimeoriginal="2017:01:02 03:04:05" -subsectimeoriginal=0.1 a.jpg
$ exiftool -datetimeoriginal="2017:01:02 03:04:05" -subsectimeoriginal=0.01 b.jpg
$ exiftool -datetimeoriginal="2017:01:02 03:04:05" -subsectimeoriginal=0.002 c.jpg
3. Import the photos into LR.
4. In the Metadata IPTC panel, observe that Date Created shows what was set in step 2:
a.jpg: 2017-01-02T03:04:05.1
b.jpg: 2017-01-02T03:04:05.01
c.jpg: 2017-01-02T03:04:05.002
5. In Library grid view, do View > Sort > Capture Time.
6. Observe that the sort order is incorrect: a.jpg, b.jpg, c.jpg. It should be: c.jpg, b.jpg, a.jpg.
Most likely the Lua code is doing tonumber(subSecTimeOriginal), whereas it should do tonumber(subSecTimeOriginal) / 10^#subSecTimeOriginal.
Tested in LR CC 2015.10 / OS X 10.11.3.